2025-02-01 13:11:10 +01:00
|
|
|
import { Column, ColumnType, Entity, ManyToOne, PrimaryColumn } from "typeorm";
|
2025-02-15 10:59:54 +01:00
|
|
|
import { user } from "./management/user";
|
2025-02-01 13:11:10 +01:00
|
|
|
import { getTypeByORM } from "../migrations/ormHelper";
|
2024-08-22 11:40:31 +02:00
|
|
|
|
|
|
|
@Entity()
|
|
|
|
export class refresh {
|
2024-08-25 10:09:57 +02:00
|
|
|
@PrimaryColumn({ type: "varchar", length: 255 })
|
2024-08-22 11:40:31 +02:00
|
|
|
token: string;
|
|
|
|
|
2025-01-28 11:09:42 +01:00
|
|
|
@PrimaryColumn()
|
|
|
|
userId: string;
|
2024-08-25 10:09:57 +02:00
|
|
|
|
2025-02-01 13:11:10 +01:00
|
|
|
@Column({ type: getTypeByORM("datetime").type as ColumnType })
|
2024-08-22 11:40:31 +02:00
|
|
|
expiry: Date;
|
|
|
|
|
2024-09-14 11:33:13 +02:00
|
|
|
@ManyToOne(() => user, {
|
|
|
|
nullable: false,
|
|
|
|
onDelete: "CASCADE",
|
|
|
|
onUpdate: "RESTRICT",
|
|
|
|
})
|
2024-08-22 11:40:31 +02:00
|
|
|
user: user;
|
|
|
|
}
|