2021-12-01 22:18:26 -05:00
|
|
|
import { Entity, PrimaryGeneratedColumn, ManyToOne, Column } from 'typeorm';
|
2021-11-30 17:40:07 -05:00
|
|
|
import { Role } from './role.entity';
|
|
|
|
import { User } from './user.entity';
|
|
|
|
|
|
|
|
@Entity()
|
|
|
|
export class UserRole {
|
|
|
|
@PrimaryGeneratedColumn()
|
|
|
|
id: number;
|
|
|
|
|
2021-12-01 22:18:26 -05:00
|
|
|
@Column()
|
|
|
|
roleId: number;
|
|
|
|
|
|
|
|
@Column()
|
|
|
|
userId: number;
|
|
|
|
|
2022-01-07 12:19:34 -05:00
|
|
|
@Column()
|
|
|
|
contextId: string;
|
|
|
|
|
2021-11-30 17:40:07 -05:00
|
|
|
@ManyToOne(() => Role, (role) => role.userRoles)
|
|
|
|
role: Role;
|
|
|
|
|
|
|
|
@ManyToOne(() => User, (user) => user.userRoles)
|
|
|
|
user: User;
|
|
|
|
}
|