mailtrain/server/lib/knex.js

27 lines
619 B
JavaScript
Raw Normal View History

2017-05-28 16:49:00 +00:00
'use strict';
const config = require('config');
const moment = require('moment');
2017-05-28 16:49:00 +00:00
const knex = require('knex')({
client: 'mysql2',
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: {
directory: __dirname + '/../setup/knex/migrations'
}
//, debug: true
2017-05-28 16:49:00 +00:00
});
2017-05-28 16:49:00 +00:00
module.exports = knex;