17 lines
354 B
TypeScript
17 lines
354 B
TypeScript
import { Entity, Index, OptionalProps, PrimaryKey, Property } from '@mikro-orm/core';
|
|
|
|
@Entity({ tableName: 'otp' })
|
|
@Index({ properties: ['phone'] })
|
|
export class Otp {
|
|
[OptionalProps]?: 'createdAt'
|
|
|
|
@PrimaryKey({ type: 'varchar', })
|
|
phone!: string;
|
|
|
|
@Property()
|
|
code!: string;
|
|
|
|
@Property({ columnType: 'timestamptz' })
|
|
expiresAt!: Date
|
|
}
|