-
Notifications
You must be signed in to change notification settings - Fork 0
/
knexfile.js
51 lines (47 loc) · 1.1 KB
/
knexfile.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// $lab:coverage:off$
const Confidence = require('confidence')
const env = process.env.NODE_ENV
const databaseUrl = process.env.DATABASE_URL
const testDatabaseUrl = process.env.DATABASE_URL_TEST
const debugKnex = process.env.DEBUG_KNEX ? true : false
const store = new Confidence.Store({
client: 'pg',
connection: {
$filter: 'env',
development: databaseUrl,
production: databaseUrl,
staging: databaseUrl,
testing: databaseUrl,
test: testDatabaseUrl,
$default: {
database: {
$filter: 'env',
$default: 'u235core',
test: 'u235core'
},
host: 'localhost',
port: 5432,
user: {
$filter: 'env',
$default: 'u235core',
test: 'u235core'
},
password: {
$filter: 'env',
$default: 'u235coredbpassword',
test: 'u235coredbpassword'
}
}
},
debug: debugKnex,
migrations: {
directory: './db/migrations',
tableName: 'knex_migrations'
},
seeds: {
directory: './db/seeds'
}
})
const filter = { env: env }
module.exports = store.get('/', filter)
// $lab:coverage:on$