Create a migration file
mainMigrations follow the [umzug] schema. Each migration file must export an object with up and down functions.
- The
upfunction handles applying the change. - The
downfunction handles reverting the change.
Asynchronous logic can be handled by either returning a Promise or calling the done callback. If you pass an argument to the done callback, it will be treated as an error.
You can access the Sequelize instance via queryInterface.sequelize.
"use strict";
module.exports = {
up: function(queryInterface, Sequelize, done) {
done();
},
down: function(queryInterface) {
return new Promise(function (resolve, reject) {
resolve();
});
}
};