import { Column, Entity, ManyToMany, OneToMany, PrimaryColumn } from "typeorm"; import { user } from "./user"; import { rolePermission } from "./role_permission"; @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[]; @OneToMany(() => rolePermission, (rolePermission) => rolePermission.role) permissions: rolePermission[]; }