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

15 lines
332 B
TypeScript
Raw Normal View History

2024-08-27 15:54:59 +00:00
import { Column, Entity, ManyToMany, PrimaryColumn } from "typeorm";
import { user } from "./user";
@Entity()
export class role {
@PrimaryColumn({ generated: "increment", type: "int" })
id: number;
@Column({ type: "varchar", length: 255 })
role: string;
@ManyToMany(() => user, (user) => user.roles)
users: user[];
}