Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
with
62 additions
and 2 deletions.
- +21 −0 knexfile.js
- 0 lib/migrations/.gitkeep
- 0 lib/models/.gitkeep
- +7 −0 lib/plugins/@hapipal.schwifty.js
- +10 −2 package.json
- +24 −0 server/manifest.js
@@ -0,0 +1,21 @@ | ||
'use strict'; | ||
|
||
const Path = require('path'); | ||
const Hoek = require('@hapi/hoek'); | ||
const Manifest = require('./server/manifest'); | ||
const Plugin = require('./lib/plugins/@hapipal.schwifty'); | ||
|
||
// Take schwifty registration's knex option | ||
// but specify the plugin's migrations directory | ||
|
||
module.exports = Hoek.applyToDefaults( | ||
{ | ||
migrations: { | ||
directory: Path.relative(process.cwd(), Plugin.options.migrationsDir) | ||
} | ||
}, | ||
Manifest | ||
.get('/register/plugins', process.env) | ||
.find(({ plugin }) => plugin === '@hapipal/schwifty') | ||
.options.knex | ||
); |
Empty file.
Empty file.
@@ -0,0 +1,7 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
options: { | ||
migrationsDir: `${__dirname}/../migrations` | ||
} | ||
}; |