Skip to content

postgrelize / DefinitionOptions

Type Alias: DefinitionOptions ​

DefinitionOptions = ModelDefaults & Readonly<{ comment?: string; createdAt?: string | boolean; deletedAt?: string | boolean; indexes?: readonly IndexOptions[]; modelName?: string; name?: ModelNameOptions; schemaDelimiter?: string; tableName?: string; temporary?: boolean; unlogged?: boolean; updatedAt?: string | boolean; version?: boolean | string; }>

Defined in: src/model/model-definition.ts:56

Table-level model options shared by Model.init and sequelize.define.

Extends the model defaults (paranoid, timestamps, schema, ...).

Example ​

ts
const opts: DefinitionOptions = {
  modelName: 'Invoice',
  tableName: 'invoices',
  timestamps: true,
  paranoid: true,
  version: true,
  indexes: [{ fields: ['number'], unique: true }],
};

Released under the MIT License.