When you create a brand new database, Sequelize creates a table called SequelizeMeta. Inside contains a list of migration files already executed. This is great and all, but the problem is that it is empty when a new database is created for the first time which results in all migration files being executed on a database when the migration CLI command is run. This is bad because sequelize migration scripts are not designed to handle "IF NOT EXISTS" scenarios.
Create a script that populates this SequelizeMeta table when a new DB is created. Or, think of some other way to handle this such as using Sequelize seeds to pre-populate the table.
When you create a brand new database, Sequelize creates a table called SequelizeMeta. Inside contains a list of migration files already executed. This is great and all, but the problem is that it is empty when a new database is created for the first time which results in all migration files being executed on a database when the migration CLI command is run. This is bad because sequelize migration scripts are not designed to handle "IF NOT EXISTS" scenarios.
Create a script that populates this SequelizeMeta table when a new DB is created. Or, think of some other way to handle this such as using Sequelize seeds to pre-populate the table.