Skip to main content

Function: Unique()

Call Signature​

Unique(name?): PropertyDecorator

Defined in: service-core/src/decorators/PersistenceDecorators.ts:270

Declares a unique constraint. This is shorthand for @Index with the unique option set to true and may be applied to a property (single-column constraint) or a class (compound constraint).

Parameters​

name?​

string

Returns​

PropertyDecorator

Call Signature​

Unique(fields): ClassDecorator

Defined in: service-core/src/decorators/PersistenceDecorators.ts:271

Declares a unique constraint. This is shorthand for @Index with the unique option set to true and may be applied to a property (single-column constraint) or a class (compound constraint).

Parameters​

fields​

string[]

Returns​

ClassDecorator

Call Signature​

Unique(name, fields): ClassDecorator

Defined in: service-core/src/decorators/PersistenceDecorators.ts:272

Declares a unique constraint. This is shorthand for @Index with the unique option set to true and may be applied to a property (single-column constraint) or a class (compound constraint).

Parameters​

name​

string

fields​

string[]

Returns​

ClassDecorator