knex-migrate
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -29,3 +29,3 @@ #!/usr/bin/env node | ||
umzug = umzugKnex((0, _knex2.default)(config())); | ||
umzug = umzugKnex(knex(config())); | ||
_context.next = 5; | ||
@@ -116,2 +116,6 @@ return umzug.storage.ensureTable(); | ||
var _reqCwd = require('req-cwd'); | ||
var _reqCwd2 = _interopRequireDefault(_reqCwd); | ||
var _meow = require('meow'); | ||
@@ -125,6 +129,2 @@ | ||
var _knex = require('knex'); | ||
var _knex2 = _interopRequireDefault(_knex); | ||
var _lodash = require('lodash'); | ||
@@ -134,3 +134,5 @@ | ||
var cli = (0, _meow2.default)('\n Usage\n $ knex-migrate <command> [options]\n\n Commands\n pending Lists all pending migrations\n list Lists all executed migrations\n up Performs all pending migrations\n down Rollbacks last migration\n rollback Rollbacks last batch of migrations\n redo Rollbacks last batch and performs all migrations\n\n Options for "up" and "down":\n --to, -t Migrate upto (downto) specific version\n --from, -f Start migration from specific version\n --only, -o Migrate only specific version\n\n Examples\n $ knex-migrate up # migrate everytings\n $ knex-migrate up --to 20160905 # migrate upto given migration\n $ knex-migrate up --only 201609085 # migrate up single migration\n $ knex-migrate down --to 0 # rollback all migrations\n $ knex-migrate down # rollback single migration\n $ knex-migrate rollback # rollback previous "up"\n $ knex-migrate redo # rollback and migrate everything\n', { | ||
var knex = (0, _reqCwd2.default)('knex'); | ||
var cli = (0, _meow2.default)('\n Usage\n $ knex-migrate <command> [options]\n\n Commands\n pending Lists all pending migrations\n list Lists all executed migrations\n up Performs all pending migrations\n down Rollbacks last migration\n rollback Rollbacks last batch of migrations\n redo Rollbacks last batch and performs all migrations\n\n Options for "up" and "down":\n --to, -t Migrate upto (downto) specific version\n --from, -f Start migration from specific version\n --only, -o Migrate only specific version\n\n As a convenience, you can skip --to flag, and just provide migration name.\n\n Examples\n $ knex-migrate up # migrate everytings\n $ knex-migrate up 20160905 # migrate upto given migration name\n $ knex-migrate up --to 20160905 # the same as above\n $ knex-migrate up --only 201609085 # migrate up single migration\n $ knex-migrate down --to 0 # rollback all migrations\n $ knex-migrate down # rollback single migration\n $ knex-migrate rollback # rollback previous "up"\n $ knex-migrate redo # rollback and migrate everything\n', { | ||
alias: { | ||
@@ -204,2 +206,6 @@ to: 't', | ||
function umzugOptions() { | ||
if ((0, _lodash.isNil)(cli.flags.to) && !(0, _lodash.isNil)(cli.input[1])) { | ||
cli.flags.to = cli.input[1]; | ||
} | ||
if ((0, _lodash.isNil)(cli.flags.to) && (0, _lodash.isNil)(cli.flags.from)) { | ||
@@ -213,2 +219,10 @@ if ((0, _lodash.isNil)(cli.flags.only)) { | ||
if (cli.flags.to === '0') { | ||
cli.flags.to = 0; | ||
} | ||
if (cli.flags.from === '0') { | ||
cli.flags.from = 0; | ||
} | ||
return (0, _lodash.omitBy)({ to: cli.flags.to, from: cli.flags.from }, _lodash.isNil); | ||
@@ -215,0 +229,0 @@ } |
{ | ||
"name": "knex-migrate", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"license": "MIT", | ||
@@ -13,2 +13,3 @@ "bin": "lib/cli.js", | ||
"meow": "^3.7.0", | ||
"req-cwd": "^1.0.1", | ||
"umzug": "^1.11.0" | ||
@@ -15,0 +16,0 @@ }, |
@@ -44,5 +44,8 @@ ![Modern Node Boilerplate](http://i.imgur.com/MMWMf5T.png) | ||
As a convenience, you can skip --to flag, and just provide migration name. | ||
Examples | ||
$ knex-migrate up # migrate everytings | ||
$ knex-migrate up --to 20160905 # migrate upto given migration | ||
$ knex-migrate up 20160905 # migrate upto given migration name | ||
$ knex-migrate up --to 20160905 # the same as above | ||
$ knex-migrate up --only 201609085 # migrate up single migration | ||
@@ -52,3 +55,3 @@ $ knex-migrate down --to 0 # rollback all migrations | ||
$ knex-migrate rollback # rollback previous "up" | ||
$ knex-migrate redo # rollback and migrate previous batch | ||
$ knex-migrate redo # rollback and migrate everything | ||
``` | ||
@@ -55,0 +58,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17747
377
60
7
6
+ Addedreq-cwd@^1.0.1
+ Addedreq-cwd@1.0.1(transitive)
+ Addedreq-from@1.0.1(transitive)
+ Addedresolve-from@2.0.0(transitive)