LocChat/server/entities/user_role.entity.ts
2021-11-30 15:40:07 -07:00

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;
}