Permalink
Browse files

(flavor) objection v2.3.2

  • Loading branch information...
devinivy committed Dec 15, 2018
1 parent 8e24c92 commit 7ff42b8f539e078d9ee12b117687ef0e186d47ce
Showing with 61 additions and 2 deletions.
  1. +21 −0 knexfile.js
  2. 0 lib/migrations/.gitkeep
  3. 0 lib/models/.gitkeep
  4. +9 −0 lib/plugins/schwifty.js
  5. +11 −2 package.json
  6. +20 −0 server/manifest.js
@@ -0,0 +1,21 @@
'use strict';
const Path = require('path');
const Hoek = require('hoek');
const Manifest = require('./server/manifest');
const PluginConfig = require('./lib/plugins/schwifty').plugins.options;
// Take schwifty registration's knex option
// but specify the plugin's migrations directory
module.exports = Hoek.applyToDefaults(
{
migrations: {
directory: Path.relative(process.cwd(), PluginConfig.migrationsDir)
}
},
Manifest
.get('/register/plugins')
.find(({ plugin }) => plugin === 'schwifty')
.options.knex
);
No changes.
No changes.
@@ -0,0 +1,9 @@
'use strict';
module.exports = {
plugins: {
options: {
migrationsDir: `${__dirname}/../migrations`
}
}
};
@@ -3,14 +3,20 @@
"version": "2.2.0",
"main": "lib/index.js",
"scripts": {
"knex": "knex",
"start": "node server",
"test": "lab -a code -L",
"test": "lab -a code -I 'core,__core-js_shared__,regeneratorRuntime,_babelPolyfill' -L",
"lint": "eslint ."
},
"dependencies": {
"boom": "7.x.x",
"haute-couture": "3.x.x",
"joi": "14.x.x"
"joi": "14.x.x",
"objection": "1.x.x",
"schwifty": "4.x.x"
},
"peerDependencies": {
"knex": "0.16.x"
},
"devDependencies": {
"code": "5.x.x",
@@ -21,8 +27,11 @@
"eslint-plugin-hapi": "4.x.x",
"glue": "5.x.x",
"hapi": "17.x.x",
"hoek": "6.x.x",
"hpal-debug": "1.x.x",
"knex": "0.16.x",
"lab": "18.x.x",
"sqlite3": "4.x.x",
"toys": "2.x.x"
}
}
@@ -33,6 +33,26 @@ module.exports = new Confidence.Store({
plugin: '../lib', // Main plugin
options: {}
},
{
plugin: 'schwifty',
options: {
$filter: 'NODE_ENV',
$default: {},
$base: {
migrateOnStart: true,
knex: {
client: 'sqlite3',
useNullAsDefault: true, // Suggested for sqlite3
connection: {
filename: ':memory:'
}
}
},
production: {
migrateOnStart: false
}
}
},
{
plugin: {
$filter: { $env: 'NODE_ENV' },

0 comments on commit 7ff42b8

Please sign in to comment.