forked from noxious/server
Added ORM entities
This commit is contained in:
17
src/entities/passwordResetToken.ts
Normal file
17
src/entities/passwordResetToken.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import { Entity, ManyToOne, PrimaryKey, Property } from '@mikro-orm/core';
|
||||
import { User } from './user';
|
||||
|
||||
@Entity()
|
||||
export class PasswordResetToken {
|
||||
@PrimaryKey()
|
||||
id!: number;
|
||||
|
||||
@ManyToOne(() => User)
|
||||
user!: User;
|
||||
|
||||
@Property({ unique: true })
|
||||
token!: string;
|
||||
|
||||
@Property()
|
||||
createdAt = new Date();
|
||||
}
|
Reference in New Issue
Block a user