How to bulkCreate data with deleted_at fields? #15957
Unanswered
wmla419
asked this question in
Help & Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
`const db = require('./models');
const records = [
{ field1: 'value1', field2: 'value2',created_at:"2023-01-01 12:00:00", deleted_at: NULL},
{ field1: 'value3', field2: 'value4', created_at:"2023-01-01 12:00:00", deleted_at: new Date() },
];
db.MyModel.bulkCreate(records).then((result) => {
console.log(result);
}).catch((err) => {
console.error(err);
});
`
I am trying to migrate my old database to a new database schema using sequelize ORM, however, I found that sequelize bulkCreate function will ignore all my old created_at and deleted_at fields, is there any way I can disable this settings?
Beta Was this translation helpful? Give feedback.
All reactions