mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-16 18:56:22 +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 { AbstractEntity } from '../../abstract/entities/abstract.entity';
|
||||||
import { RoleTypeDto } from '../dtos/role.type.dto';
|
import { RoleTypeDto } from '../dtos/role.type.dto';
|
||||||
import { RoleType } from '@app/common/constants/role.type.enum';
|
import { RoleType } from '@app/common/constants/role.type.enum';
|
||||||
import { UserRoleEntity } from '../../user-role/entities';
|
import { UserRoleEntity } from '../../user-role/entities';
|
||||||
|
|
||||||
@Entity({ name: 'role-type' })
|
@Entity({ name: 'role-type' })
|
||||||
|
@Unique(['type'])
|
||||||
export class RoleTypeEntity extends AbstractEntity<RoleTypeDto> {
|
export class RoleTypeEntity extends AbstractEntity<RoleTypeDto> {
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
nullable: false,
|
||||||
|
Reference in New Issue
Block a user