16 lines
356 B
TypeScript
16 lines
356 B
TypeScript
import { Entity, PrimaryGeneratedColumn, ManyToOne } from 'typeorm';
|
|
import { Role } from './role.entity';
|
|
import { User } from './user.entity';
|
|
|
|
@Entity()
|
|
export class UserRole {
|
|
@PrimaryGeneratedColumn()
|
|
id: number;
|
|
|
|
@ManyToOne(() => Role, (role) => role.userRoles)
|
|
role: Role;
|
|
|
|
@ManyToOne(() => User, (user) => user.userRoles)
|
|
user: User;
|
|
}
|