import { Column , Entity , JoinTable , ManyToMany , OneToOne , PrimaryGeneratedColumn } from 'typeorm' ; import { User } from './user.entity' ; @ Entity ( 'role' ) export class Role { @ PrimaryGeneratedColumn ( ) id : number ; @ Column ( { unique : true } ) name : string ; @ ManyToMany ( type => User , user => user . roles ) users : User [ ] ; }