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

21 lines
424 B
TypeScript

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