From dff9ba15eb31505597c27154408426f196985180 Mon Sep 17 00:00:00 2001 From: Dragory Date: Mon, 9 Jul 2018 03:12:49 +0300 Subject: [PATCH] Fix DB timezone not being applied --- knexfile.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/knexfile.js b/knexfile.js index 325130cf..0612a559 100644 --- a/knexfile.js +++ b/knexfile.js @@ -7,7 +7,13 @@ module.exports = { user: process.env.DB_USER, password: process.env.DB_PASSWORD, db: process.env.DB_DATABASE, - timezone: 'UTC', charset: 'utf8mb4' + }, + pool: { + afterCreate(connection, callback) { + connection.query("SET time_zone = '+0:00';", err => { + callback(err, connection); + }); + } } };