You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given a tables with created_at and updated_at defined --
CREATE TABLE scan_forms (
id character varying(255) PRIMARY KEY,
customer_id integer,
pickup_address_id integer,
customer_reference character varying(255),
package_count integer,
pickup_associate character varying(255),
pickup_time character varying(255),
ship_date timestamp without time zone NOT NULL,
created_at timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
total_weight numeric(6,2)
);
Generating the model with timestamps: true results in missing createdAt / updatedAt attributes --
{
host: 'localhost',
dialect: 'postgres',
port: '5432',
directory: `./updated-models/${sourceDbName}`, // where to write files
views: true,
caseModel: 'p', // convert snake_case column names to PascalCase field names: user_id -> userId
caseFile: 'k', // file names created for each model use kabob-case.js not snake_case.js
caseProp: 'c', // file names created for each model use camelCase.js not snake_case.js
singularize: true, // convert plural table names to singular model names
additional: { // ...options added to each model
timestamps: false // already config'd
},
tables: newTables,
noInitModels: true
}
The text was updated successfully, but these errors were encountered:
My expectation is that Models should be generated to include all table fields/columns; timestamp setting should not affect that. CreatedAt / updatedAt should always be generated and the model option for timestamps be set from the generation config.
Given a tables with created_at and updated_at defined --
Generating the model with timestamps: true results in missing createdAt / updatedAt attributes --
Generating with timestamps: false results in generated createdAt / updatedAt attributes, but disabled for use by Sequelize --
My SequelizeAuto config is --
The text was updated successfully, but these errors were encountered: