2017-05-28 16:49:00 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const config = require('config');
|
2018-11-20 22:41:10 +00:00
|
|
|
const moment = require('moment');
|
2017-05-28 16:49:00 +00:00
|
|
|
|
2018-11-18 20:31:22 +00:00
|
|
|
const knex = require('knex')({
|
2017-07-11 09:28:44 +00:00
|
|
|
client: 'mysql2',
|
2018-11-20 22:41:10 +00:00
|
|
|
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'
|
|
|
|
}
|
2018-11-20 22:41:10 +00:00
|
|
|
//, debug: true
|
2017-05-28 16:49:00 +00:00
|
|
|
});
|
|
|
|
|
2018-11-20 22:41:10 +00:00
|
|
|
|
|
|
|
|
2017-05-28 16:49:00 +00:00
|
|
|
module.exports = knex;
|