-
-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathknexfile.js
More file actions
28 lines (27 loc) · 808 Bytes
/
knexfile.js
File metadata and controls
28 lines (27 loc) · 808 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const _ = require('lodash');
const config = require('config');
const dbConfig = config.get('db');
// WARNING: This configuration is now used for both the CLI and the application.
module.exports = _.merge(...[ 'development', 'production', 'staging', 'test' ].map((environment) => {
return {
[environment]: {
client: dbConfig.type,
connection: Object.assign({
timezone: 'UTC',
multipleStatements: true,
}, dbConfig.connection),
pool: {
min: 0,
max: 40,
propagateCreateError: false,
afterCreate (connection, callback) {
connection.query('SET names utf8mb4 COLLATE utf8mb4_unicode_ci; SET TRANSACTION ISOLATION LEVEL READ COMMITTED;', callback);
},
},
seeds: {
directory: `./seeds/${environment}`,
},
acquireConnectionTimeout: 5000,
},
};
}));