Migrator

To get the migrator:

let migrator = wetland.getMigrator();

.allMigrations()

Gets all migrations from the directory on the config.

migrator.allMigrations();

.appliedMigrations()

Gets all applied migrations.

migrator.appliedMigrations();

.create()

Creates a new migration file.

migrator.create('migrationName');

.createSchema()

Creates your database schema.

migrator.createSchema();

.down()

Go down one version based on latest run migration timestamp. Pass 'run' to run the migration or 'getSQL' to get the queries.

migrator.down('run');

.getConnection()

Get the connection for the migrations tables.

migrator.getConnection();

.latest()

Go up to the latest migration. Pass 'run' to run the migration or 'getSQL' to get the queries.

migrator.latest('run');

.revert()

Revert the last run UP migration (or batch of UP migrations). Pass 'run' to run the migration or 'getSQL' to get the queries.

migrator.revert('run');

.run()

Run a specific migration. Although you can run your migration using this method, we recommend you to use .up(), .down(), .latest() and .revert() instead.

migrator.run('up', 'getSQL', '20161004123412_foo');

.up()

Go up one version based on latest run migration timestamp.

migrator.up('run');

results matching ""

    No results matching ""