node-pg-migrate
Advanced tools
Comparing version 2.14.0 to 2.15.0
# Change Log | ||
## [2.15.0] (2018-01-11) | ||
### Fixed | ||
- Handle rejections in migration actions [#148](https://github.com/salsita/node-pg-migrate/pull/148) | ||
### Added | ||
- TypeScript declaration file [#147](https://github.com/salsita/node-pg-migrate/pull/147) [#150](https://github.com/salsita/node-pg-migrate/pull/150) | ||
## [2.14.0] (2017-11-14) | ||
@@ -4,0 +14,0 @@ |
@@ -84,3 +84,3 @@ 'use strict'; | ||
return new Promise(function (resolve) { | ||
return new Promise(function (resolve, reject) { | ||
if (action.length === 2) { | ||
@@ -92,3 +92,3 @@ action(pgm, resolve); | ||
if (typeof result === 'object' && typeof result.then === 'function') { | ||
result.then(resolve); | ||
result.then(resolve).catch(reject); | ||
} else { | ||
@@ -95,0 +95,0 @@ resolve(); |
@@ -41,3 +41,3 @@ 'use strict'; | ||
if (role_options.admin) { | ||
options.push(`IN ROLE ${(0, _lodash.isArray)(role_options.admin) ? role_options.admin.join(',') : role_options.admin}`); | ||
options.push(`ADMIN ${(0, _lodash.isArray)(role_options.admin) ? role_options.admin.join(',') : role_options.admin}`); | ||
} | ||
@@ -44,0 +44,0 @@ |
@@ -13,2 +13,3 @@ { | ||
"main": "dist/runner.js", | ||
"types": "index.d.ts", | ||
"keywords": [ | ||
@@ -33,3 +34,3 @@ "db", | ||
], | ||
"version": "2.14.0", | ||
"version": "2.15.0", | ||
"engines": { | ||
@@ -36,0 +37,0 @@ "node": ">=4.0.0" |
@@ -125,2 +125,19 @@ # node-pg-migrate | ||
## Transpiling Babel or Typescript | ||
You can use babel or typescript for transpiling migration files. It requires a little setup to use: | ||
1. Update `scripts` section in your `package.json` to contain `'migrate': 'node migrate.js'` | ||
1. Create `migrate.js` file with contents: | ||
``` | ||
// require('babel-core/register')( { ... your babel config ... } ); | ||
// require('ts-node').register( { ... your typescript config ... } ); | ||
require('./node_modules/node-pg-migrate/bin/node-pg-migrate'); | ||
``` | ||
Uncomment/Use either babel or typescript hook and adjust your config for compiler. | ||
You can then use migration as usual via e.g. `npm run migrate up`. :tada: | ||
## Defining Migrations | ||
@@ -127,0 +144,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
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
129222
22
1552
798