You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
471 B
JavaScript
10 lines
471 B
JavaScript
var config = require('./knexfile.js'); //requiring the knexfile that contains our connection object.
|
|
var env = 'development'; // specify the config enviroment
|
|
var knex = require('knex')(config[env]); // imports knex with our connection object (found in knexfile).
|
|
|
|
// Export the knex library for use. All knex commands remain the same.
|
|
module.exports = knex;
|
|
|
|
// Run the latest DB migrations whenever the server starts.
|
|
knex.migrate.latest([config]);
|