npm i @xinix/migrate
Create a migration file inside migrations
directory of your project.
module.exports = {
async up () {
// do something async here
}
async down () {
// do something async here
}
};
Create file with name .migraterc.js
and export umzug options. Example,
module.exports = {
storage: 'json', // new require('@xinix/migrate/storages/norm')({ manager }),
storageOptions: {
path: 'the-umzug-file.json',
},
};
Migration files will be sorted by its name.
Show current status of migration.
migrate status
Migrate up to specified file, or to the latest state.
migrate up [<migrate-file>]
Migrate down to specified file, or to earliest state.
migrate down [<migrate-file>]
Migrate to next state.
migrate next
Migrate to previous state.
migrate prev