summaryrefslogtreecommitdiff
path: root/server/entities/user_role.entity.ts
blob: 0a6c5c6fb801666b865ac55b7d5d079f5cc29011 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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;
}