1@Entity()
2@Unique(["field1"]) // one field
3@Unique("index_name", ["field1", "field2"]) // named; multiple fields
4export class MyEntity {
5 @PrimaryGeneratedColumn('uuid')
6 id: string;
7
8 @Column()
9 field1: string;
10
11 @Column()
12 field2: string;
13}