I was trying to use sequalize seed to initialize the table rows, but I got error return:
column "createdAt" of relation "users" does not exist
It actually is "created_at" as the field, so my question is that how can I seed the table with snake or underscore option?
My seed code as following:
"use strict";
module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.bulkInsert(
"users",
[
{
firstname: "John",
lastname: "Doe",
email: "[email protected]",
createdAt: new Date(),
updatedAt: new Date()
}
],
{}
);
},
down: (queryInterface, Sequelize) => {
return queryInterface.bulkDelete("users", null, {});
}
};
You pass those information while defining your configurations for database connection like below.
Here
config
is your db configuration. You add other configuration on a separatedefine