mailtrain/server/lib/knex.js

29 lines
678 B
JavaScript
Raw Normal View History

2017-05-28 16:49:00 +00:00
'use strict';
const config = require('config');
2019-01-04 20:31:01 +00:00
const path = require('path');
const knexConstructor = require('knex');
2017-05-28 16:49:00 +00:00
const knex = require('knex')({
client: 'mysql',
connection: {
...config.mysql,
// DATE and DATETIME types contain no timezone info. The MySQL driver tries to interpret them w.r.t. to local time, which
// does not work well with assigning these values in UTC and handling them as if in UTC
dateStrings: [
'DATE',
'DATETIME'
]
},
2017-05-28 16:49:00 +00:00
migrations: {
2019-01-04 20:31:01 +00:00
directory: path.join(__dirname, '..', 'setup', 'knex', 'migrations')
2017-05-28 16:49:00 +00:00
}
2019-01-04 20:31:01 +00:00
//, debug: true
2017-05-28 16:49:00 +00:00
});
2017-05-28 16:49:00 +00:00
module.exports = knex;