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

22 lines
424 B
TypeScript
Raw Normal View History

import { Column, Entity, ManyToOne, PrimaryColumn } from "typeorm";
import { user } from "./user";
@Entity()
export class refresh {
2024-08-25 08:09:57 +00:00
@PrimaryColumn({ type: "varchar", length: 255 })
token: string;
2024-08-25 08:09:57 +00:00
@PrimaryColumn({ type: "int" })
userId: number;
@Column({ type: "datetime" })
expiry: Date;
@ManyToOne(() => user, {
nullable: false,
onDelete: "CASCADE",
onUpdate: "RESTRICT",
})
user: user;
}