rittenhop-dev/versions/5.94.2/node_modules/knex-migrator/bin/knex-migrator-init

35 lines
912 B
Plaintext
Raw Normal View History

2024-09-23 19:40:12 -04:00
#!/usr/bin/env node
var program = require('commander');
var utils = require('../lib/utils');
var logging = require('@tryghost/logging');
var knexMigrator;
utils.getKnexMigrator({path: process.cwd()})
.then(function (KnexMigrator) {
program
.option('--skip <item>')
.option('--only <item>')
.option('--mgpath <path>')
.parse(process.argv);
try {
knexMigrator = new KnexMigrator({knexMigratorFilePath: program.mgpath, executedFromShell: true});
} catch (err) {
logging.error(err);
process.exit(1);
}
return knexMigrator.init({
skip: program.skip,
only: program.only
}).then(function () {
logging.info('Finished database init!');
});
})
.catch(function (err) {
logging.error(err);
process.exit(1);
});