B
B
Bogdan2019-05-13 14:42:28
Node.js
Bogdan, 2019-05-13 14:42:28

Sequelize field name name?

Misters, and do not prompt in what there can be a problem Sequelize does not insert the field "name" into request?

models.GalleryCategory.create({ num: 1, visible: true, name: 'Test' });

Executing (default): INSERT INTO "GalleryCategories" ("id","num","visible","createdAt","updatedAt") VALUES (DEFAULT,$1,$2,$3,$4) RETURNING *; { plain: false,
  raw: false,
  logging: [Function: bound consoleCall],
  hooks: true,
  validate: true,
  fields: [ 'id', 'num', 'visible', 'createdAt', 'updatedAt' ],
  defaultFields: [ 'id', 'num', 'visible', 'createdAt', 'updatedAt' ],
  returning: true,
  hasTrigger: undefined,
  dialect: 'postgres',
  dialectModule: null,
  dialectModulePath: null,
  host: 'localhost',
  protocol: 'tcp',
  define: {},
  query: {},
  sync: {},
  timezone: '+00:00',
  clientMinMessages: 'warning',
  standardConformingStrings: true,
  omitNull: false,
  native: false,
  replication: false,
  ssl: undefined,
  pool: {},
  quoteIdentifiers: true,
  retry: { max: 5, match: [ 'SQLITE_BUSY: database is locked' ] },
  transactionType: 'DEFERRED',
  isolationLevel: null,
  databaseVersion: 0,
  typeValidation: false,
  benchmark: false,
  username: 'postgres',
  password: '***',
  database: '***',
  port: '5432',
  type: 'INSERT',
  instance:
   GalleryCategory {
     dataValues:
      { id: null,
        num: 1,
        visible: true,
        updatedAt: 2019-05-13T11:39:47.806Z,
        createdAt: 2019-05-13T11:39:47.806Z },
     _previousDataValues: { num: undefined, visible: undefined },
     _changed: { num: true, visible: true },
     _modelOptions:
      { timestamps: true,
        validate: {},
        freezeTableName: false,
        underscored: false,
        paranoid: false,
        rejectOnEmpty: false,
        whereCollection: null,
        schema: null,
        schemaDelimiter: '',
        defaultScope: {},
        scopes: {},
        indexes: [],
        name: [Object],
        omitNull: false,
        sequelize: [Sequelize],
        hooks: {} },
     _options:
      { isNewRecord: true,
        _schema: null,
        _schemaDelimiter: '',
        attributes: undefined,
        include: undefined,
        raw: undefined,
        silent: undefined },
     isNewRecord: true },
  model: GalleryCategory,
  bind:
   [ 1,
     true,
     '2019-05-13 11:39:47.806 +00:00',
     '2019-05-13 11:39:47.806 +00:00' ] }

Thank you.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question