db-migrate-boilerplate
Reduce the amount of boilerplate in your project needed to support raw SQL migrations using db-migrate.
Usage
Install via npm
:
$ npm install db-migrate-boilerplate
Replace the default migration handler generated by db-migrate with this:
'use strict' const path = const boilerplate = moduleexports =
Make sure to replace the paths with your expected values.
Why?
db-migrate generates a lot of boilerplate code when creating a raw SQL migration. Here is an example:
'use strict'; var dbm;var type;var seed;var fs = ;var path = ;var Promise; /** * We receive the dbmigrate dependency from dbmigrate initially. * This enables us to not have to rely on NODE_PATH. */exports { dbm = optionsdbmigrate; type = dbmdataType; seed = seedLink; Promise = optionsPromise;}; exports { var filePath = path; return { fs; } ;}; exports { var filePath = path; return { fs; } ;}; exports_meta = "version": 1;
License
MIT