OptionalnameCustom constraint name (auto-generated if not provided)
OptionalconstraintAlias for name - custom constraint name
OptionalfieldsSingle field or array of fields for composite constraints
OptionalcompositeComposite foreign key fields - used with compositeKey in associations
OptionalreferencesOptionalcompositeKey?: string[]Composite foreign key fields on the referenced table
OptionalonDelete?: OptionalonUpdate?: "CASCADE" | "RESTRICT" | "SET NULL" | "NO ACTION" | ReferentialActionOptionalmatch?: "FULL" | "PARTIAL" | "SIMPLE"PostgreSQL: match type for foreign key (FULL, PARTIAL, SIMPLE)
Optionaldeferrable?: "INITIALLY DEFERRED" | "INITIALLY IMMEDIATE" | "NOT DEFERRABLE"PostgreSQL: deferrable constraint
OptionalcheckOptionaldeferrablePostgreSQL: deferrable constraint
OptionalmatchForeign key match type (FULL, PARTIAL)
A table constraint: primary key, unique, check, foreign key or exclusion. Composite constraints list every participating column in
fields.