-
Notifications
You must be signed in to change notification settings - Fork 16
/
knexConfig.js
36 lines (32 loc) · 871 Bytes
/
knexConfig.js
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
29
30
31
32
33
34
35
36
'use strict';
const path = require('path');
const envSchema = require('env-schema');
const { config: envConfig } = require('./environmentVariables');
const config = envSchema(envConfig);
const { DB_HOST, DB_USER, DB_PASSWORD, DB_NAME, DB_PORT, DB_MIN_CONNECTIONS, DB_MAX_CONNECTIONS } =
config;
const databaseConfiguration = {
client: 'postgres',
pool: {
min: parseInt(DB_MIN_CONNECTIONS),
max: parseInt(DB_MAX_CONNECTIONS)
},
acquireConnectionTimeout: 10000,
migrations: {
tableName: 'knex_migrations',
directory: path.resolve(__dirname, '../migrations')
},
seeds: {
directory: path.resolve(__dirname, '../seeds')
},
connection: {
host: DB_HOST,
user: DB_USER,
password: DB_PASSWORD,
database: DB_NAME,
port: DB_PORT
},
asyncStackTraces: true,
debug: false
};
module.exports = databaseConfiguration;