otp in database

This commit is contained in:
2026-01-20 20:27:01 +03:30
parent 897db44c66
commit 6ba36ca130
13 changed files with 113 additions and 124 deletions
+16
View File
@@ -0,0 +1,16 @@
import { Entity, Index, OptionalProps, PrimaryKey, Property } from '@mikro-orm/core';
@Entity({ tableName: 'otps' })
@Index({ properties: ['phone'] })
export class Otp {
[OptionalProps]?: 'createdAt'
@PrimaryKey({ type: 'varchar', })
phone!: string;
@Property()
code!: string;
@Property({ columnType: 'timestamptz' })
expiresAt!: Date
}