I'm seeding a table using a model like so
module.exports = {
up: async function (queryInterface, Sequelize) {
const company = await Company.create({ name });
Works fine in staging but in production there is an error
20170727141749-admins: migrating =======
Executing (default): INSERT INTO
Companies
(id
,name
,createdAt
,updatedAt
) VALUES (DEFAULT,'Co name','2018-02-28 18:54:37','2018-02-28 18:54:37');Seed file failed with error: Validation error SequelizeUniqueConstraintError: Validation error
Prod command uses --env production flag like so
sequelize db:seed:all --env production
Staging doesn't use the flag
sequelize db:seed:all
Seems that should not matter. Staging and production apps both run on the same box. NODE_ENV=staging on that box, so the -env flag is being used to target the prod db for the prod deployment. Any ideas?