15 lines
332 B
TypeScript
15 lines
332 B
TypeScript
|
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[];
|
||
|
}
|