Skip to content

Commit

Permalink
Merge pull request #25 from vinicius0026/dependencies-update
Browse files Browse the repository at this point in the history
Dependencies update
  • Loading branch information
vinicius0026 committed Sep 4, 2017
2 parents e1aa854 + 1ed2a31 commit d7bfc32
Show file tree
Hide file tree
Showing 4 changed files with 337 additions and 366 deletions.
1 change: 1 addition & 0 deletions bin/rethinkdb-migrate
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ internals.migrateOptions = Object.assign({}, internals.createOptions, {
}
})

/* eslint-disable no-unused-expressions */
require('yargs')
.usage('Usage: $0 <command> [options]')
.command({
Expand Down
23 changes: 11 additions & 12 deletions lib/migrate.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,12 @@ function wait (options) {
.then(toArray)
.then(list => {
if (list.indexOf(db) !== -1) {
return r.db(options.db).wait([
{ waitFor: 'ready_for_writes', timeout: 20 }
])
.run(conn)
.then(() => options)
return r
.db(options.db).wait([
{ waitFor: 'ready_for_writes', timeout: 20 }
])
.run(conn)
.then(() => options)
}
return Promise.resolve(options)
})
Expand Down Expand Up @@ -287,13 +288,11 @@ function sortMigrations (migrations, orderDesc = false) {

function runMigrations (direction, migrations, options) {
const { r, conn } = options
return migrations
.reduce((chain, migration) =>
chain.then(() => migration.code[direction](r, conn)
.then(emit('info', `Executed migration ${migration.name} ${options.op}`))),
Promise.resolve()
)
.then(() => migrations)
return migrations.reduce(
(chain, migration) => chain.then(() => migration.code[direction](r, conn)
.then(emit('info', `Executed migration ${migration.name} ${options.op}`))),
Promise.resolve()
).then(() => migrations)
}

function saveExecutedMigrationsMetadata (migrations, options) {
Expand Down
29 changes: 17 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"coverage": "npm run coveralls && lab -c -a code -r lcov -o lcov.info && cat ./lcov.info | ./node_modules/coveralls/bin/coveralls.js",
"release": "grunt release",
"release:minor": "grunt release:minor",
"release:major": "grunt release:major"
"release:major": "grunt release:major",
"lint": "eslint \"lib/**\" \"bin/**\" \"test/**\""
},
"repository": {
"type": "git",
Expand All @@ -34,23 +35,27 @@
},
"homepage": "https://github.com/vinicius0026/rethinkdb-migrate#readme",
"devDependencies": {
"code": "^4.0.0",
"coveralls": "^2.11.15",
"eslint-config-standard": "^6.2.1",
"code": "^4.1.0",
"coveralls": "^2.13.1",
"eslint-config-standard": "^10.2.1",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-node": "^5.1.1",
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-standard": "^3.0.1",
"grunt": "^1.0.1",
"grunt-cli": "^1.2.0",
"grunt-release": "^0.14.0",
"lab": "^11.2.2",
"proxyquire": "^1.7.10",
"standard": "^8.6.0"
"lab": "^14.2.2",
"proxyquire": "^1.8.0",
"standard": "^10.0.3"
},
"dependencies": {
"fs-extra": "^2.0.0",
"joi": "^10.1.0",
"fs-extra": "^4.0.1",
"joi": "^10.6.0",
"json-mask": "^0.3.8",
"moment": "^2.17.1",
"moment": "^2.18.1",
"rethinkdb": "^2.3.3",
"rethinkdbdash": "^2.3.27",
"yargs": "^6.6.0"
"rethinkdbdash": "^2.3.31",
"yargs": "^8.0.2"
}
}
Loading

0 comments on commit d7bfc32

Please sign in to comment.