diff options
Diffstat (limited to 'src/util/entities/BackupCodes.ts')
-rw-r--r-- | src/util/entities/BackupCodes.ts | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/util/entities/BackupCodes.ts b/src/util/entities/BackupCodes.ts new file mode 100644 index 00000000..9092c14e --- /dev/null +++ b/src/util/entities/BackupCodes.ts @@ -0,0 +1,19 @@ +import { Column, Entity, JoinColumn, ManyToOne, RelationId } from "typeorm"; +import { BaseClass } from "./BaseClass"; +import { User } from "./User"; + +@Entity("backup_codes") +export class BackupCode extends BaseClass { + @JoinColumn({ name: "user_id" }) + @ManyToOne(() => User, { onDelete: "CASCADE" }) + user: User; + + @Column() + code: string; + + @Column() + consumed: boolean; + + @Column() + expired: boolean; +} \ No newline at end of file |