import * as Umzug from 'umzug'; import * as Sequelize from 'sequelize'; let someVar: Umzug.Umzug; const umzug = new Umzug({}); someVar = umzug; umzug.up().then((migrations: Umzug.Migration[]) => null); umzug.execute({ migrations: ['some-id', 'some-other-id'], method: 'up' }).then((migrations: Umzug.Migration[]) => null); umzug.pending().then((migrations: Umzug.Migration[]) => null); umzug.executed().then((migrations: Umzug.Migration[]) => null); umzug.up().then((migrations: Umzug.Migration[]) => null); umzug.up({ to: '20141101203500-task' }).then((migrations: Umzug.Migration[]) => null); umzug.up({ migrations: ['20141101203500-task', '20141101203501-task-2'] }).then((migrations: Umzug.Migration[]) => null); umzug.up('20141101203500-task').then((migrations: Umzug.Migration[]) => null); // Runs just the passed migration umzug.up(['20141101203500-task', '20141101203501-task-2']).then((migrations: Umzug.Migration[]) => null); umzug.down().then((migrations: Umzug.Migration[]) => null); umzug.down({ to: '20141031080000-task' }).then((migrations: Umzug.Migration[]) => null);
var someVar:Umzug.Umzug; var umzug = new Umzug({}); someVar = umzug; umzug.up().then(function (result) { // do something with the result }); umzug.execute({ migrations: ['some-id', 'some-other-id'], method: 'up' }).then(function (migrations) { // "migrations" will be an Array of all executed/reverted migrations. }); umzug.pending().then(function (migrations) { // "migrations" will be an Array with the names of // pending migrations. }); umzug.executed().then(function (migrations) { // "migrations" will be an Array of already executed migrations. }); umzug.up().then(function (migrations) { // "migrations" will be an Array with the names of the // executed migrations. }); umzug.up({ to: '20141101203500-task' }).then(function (migrations) {});