This repository has been archived on 2022-11-26. You can view files and clone it, but cannot push or open issues or pull requests.
IcyNet.eu/scripts/load-database.js

16 lines
345 B
JavaScript
Raw Normal View History

2017-08-02 21:24:01 +00:00
const path = require('path')
const knex = require('knex')
const objection = require('objection')
const knexfile = require(path.join(__dirname, '../knexfile'))
2020-05-28 18:30:21 +00:00
const knexDB = knex(knexfile)
const objectionModel = objection.Model
2017-08-02 21:24:01 +00:00
objectionModel.knex(knexDB)
module.exports = {
knex: knexDB,
Model: objectionModel,
destroy: knex.destroy
}