From 12e8e39023e6f1e7b2b0ed4f8c9b809ae99bc740 Mon Sep 17 00:00:00 2001 From: joker-x Date: Mon, 24 Aug 2020 07:41:19 +0200 Subject: [PATCH] Remove STRICT_TRANS_TABLES from sql_mode. Fix #936 #748 --- server/lib/knex.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/server/lib/knex.js b/server/lib/knex.js index 43cc7194..7240d312 100644 --- a/server/lib/knex.js +++ b/server/lib/knex.js @@ -17,6 +17,15 @@ const knex = require('knex')({ 'DATETIME' ] }, + pool: { + min: 2, + max: 10, + afterCreate: function(conn, cb) { + conn.query('SET sql_mode="ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION";', function (err) { + cb(err, conn); + }); + } + }, migrations: { directory: path.join(__dirname, '..', 'setup', 'knex', 'migrations') }