-
Notifications
You must be signed in to change notification settings - Fork 0
/
knexfile.js
50 lines (48 loc) · 1.28 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
const _ = require('lodash');
const path = require('path');
const baseEnv = {
client: process.env.DB_CLIENT || 'pg',
connection: {
host: process.env.DB_HOST || '127.0.0.1',
port: process.env.DB_PORT || 5432,
user: process.env.DB_USERNAME || null,
password: process.env.DB_PASSWORD || null,
database: process.env.DB_NAME || 'test-app_development',
multipleStatements: true
}
};
module.exports = {
default: baseEnv,
static: _.merge({}, baseEnv, {
migrations: {
directory: path.join(__dirname, '/db/migrations_static'),
tableName: 'migration_static_version'
}
}),
schema: _.merge({}, baseEnv, {
migrations: {
directory: path.join(__dirname, '/db/migrations_schema'),
tableName: 'migration_schema_version'
}
}),
data: _.merge({}, baseEnv, {
migrations: {
directory: path.join(__dirname, '/db/migrations_data'),
tableName: 'migration_data_version'
}
}),
seed: _.merge({}, baseEnv, {
seeds: {
directory: path.join(__dirname, '/db/seeds')
}
}),
clean: _.merge({}, baseEnv, {
migrations: {
directory: path.join(__dirname, '/db/migrations_schema'),
tableName: 'migration_schema_version'
},
seeds: {
directory: path.join(__dirname, '/db/scripts')
}
})
};