LocChat/server/entities/user_role.entity.ts

22 lines
426 B
TypeScript
Raw Normal View History

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;
2021-11-30 17:40:07 -05:00
@ManyToOne(() => Role, (role) => role.userRoles)
role: Role;
@ManyToOne(() => User, (user) => user.userRoles)
user: User;
}