-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathknexfile.js
51 lines (49 loc) · 1.2 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
const dotenv = require('dotenv').config()
const databasePassword = process.env.DBPASSWORD
const databaseName = process.env.DBNAME || process.env.MYSQL_DB
const databaseUser = process.env.DBUSER || process.env.MYSQL_USER
const databaseHost = process.env.DBHOST || process.env.MYSQL_HOST
module.exports = {
testing: {
client: 'sqlite3',
connection: {
filename: './test.db'
},
migrations: {
directory: __dirname + '/database/migrations'
},
seeds: {
directory: __dirname + '/database/seeds/development'
}
},
development: {
client: 'mysql',
connection: {
user: databaseUser,
password: databasePassword,
database: databaseName,
host: databaseHost
},
migrations: {
directory: __dirname + '/database/migrations'
},
seeds: {
directory: __dirname + '/database/seeds/development'
}
},
production: {
client: 'mysql',
connection: {
user: databaseUser,
password: databasePassword,
database: databaseName,
host: databaseHost
},
migrations: {
directory: __dirname + '/database/migrations'
},
seeds: {
directory: __dirname + '/database/seeds/production'
}
}
}