ff-admin-server/src/entity/refresh.ts

23 lines
515 B
TypeScript
Raw Normal View History

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