postgrelize / Deferrable
Variable: Deferrable ​
constDeferrable:object
Defined in: src/ddl/ddl-types.ts:49
Deferrable constraint modes (Sequelize v6 Deferrable).
Type Declaration ​
INITIALLY_DEFERRED ​
readonlyINITIALLY_DEFERRED:Readonly<Readonly<{sql:string; }>>
DEFERRABLE INITIALLY DEFERRED.
INITIALLY_IMMEDIATE ​
readonlyINITIALLY_IMMEDIATE:Readonly<Readonly<{sql:string; }>>
DEFERRABLE INITIALLY IMMEDIATE.
NOT ​
readonlyNOT:Readonly<Readonly<{sql:string; }>>
NOT DEFERRABLE.
SET_DEFERRED ​
readonlySET_DEFERRED:ConstraintModeSetter
SET CONSTRAINTS ... DEFERRED: for the deferrable option of sequelize.transaction(), defers the given constraints (all of them when used bare or called without names) for the rest of the transaction.
SET_IMMEDIATE ​
readonlySET_IMMEDIATE:ConstraintModeSetter
SET CONSTRAINTS ... IMMEDIATE: the counterpart of SET_DEFERRED.
Example ​
ts
await queryInterface.addColumn('posts', 'userId', {
type: DataTypes.INTEGER,
references: { model: 'Users', key: 'id', deferrable: Deferrable.INITIALLY_DEFERRED },
});