mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-15 10:25:23 +00:00
Add Unique constraint to 'type' column in RoleTypeEntity
This commit is contained in:
@ -1,10 +1,11 @@
|
||||
import { Column, Entity, OneToMany } from 'typeorm';
|
||||
import { Column, Entity, OneToMany, Unique } from 'typeorm';
|
||||
import { AbstractEntity } from '../../abstract/entities/abstract.entity';
|
||||
import { RoleTypeDto } from '../dtos/role.type.dto';
|
||||
import { RoleType } from '@app/common/constants/role.type.enum';
|
||||
import { UserRoleEntity } from '../../user-role/entities';
|
||||
|
||||
@Entity({ name: 'role-type' })
|
||||
@Unique(['type'])
|
||||
export class RoleTypeEntity extends AbstractEntity<RoleTypeDto> {
|
||||
@Column({
|
||||
nullable: false,
|
||||
|
Reference in New Issue
Block a user