Skip to content

xinix-technology/node-migrate

Repository files navigation

@xinix/migrate

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
  }
};

Configuration

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.

Status

Show current status of migration.

migrate status

Up

Migrate up to specified file, or to the latest state.

migrate up [<migrate-file>]

Down

Migrate down to specified file, or to earliest state.

migrate down [<migrate-file>]

Next

Migrate to next state.

migrate next

Prev

Migrate to previous state.

migrate prev

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published