How to generate a uniq key with typeorm code example
Example: typeorm @unique
@Entity()
@Unique(["field1"]) // one field
@Unique("index_name", ["field1", "field2"]) // named; multiple fields
export class MyEntity {
@PrimaryGeneratedColumn('uuid')
id: string;
@Column()
field1: string;
@Column()
field2: string;
}