forked from Marduk-Project/bia-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsequelize_config.js
46 lines (44 loc) · 1.34 KB
/
sequelize_config.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
const nconf = require('nconf');
const config = require('./config.js'); // necessario
const useSSL = typeof (nconf.get('MAINDB_SSL')) == 'boolean' ? nconf.get('MAINDB_SSL') : nconf.get('MAINDB_SSL') == 'true';
module.exports = {
development: {
username: nconf.get('MAINDB_USERNAME'),
password: nconf.get('MAINDB_PASSWORD'),
database: nconf.get('MAINDB_DATABASE'),
host: nconf.get('MAINDB_HOST'),
port: nconf.get('MAINDB_PORT'),
dialect: nconf.get('MAINDB_DIALECT'),
migrationStorageTableName: "sy_sequelize_meta",
ssl: useSSL,
dialectOptions: {
ssl: useSSL
},
},
test: {
username: nconf.get('MAINDB_USERNAME'),
password: nconf.get('MAINDB_PASSWORD'),
database: nconf.get('MAINDB_DATABASE'),
host: nconf.get('MAINDB_HOST'),
port: nconf.get('MAINDB_PORT'),
dialect: nconf.get('MAINDB_DIALECT'),
migrationStorageTableName: "sy_sequelize_meta",
ssl: useSSL,
dialectOptions: {
ssl: useSSL
},
},
production: {
username: nconf.get('MAINDB_USERNAME'),
password: nconf.get('MAINDB_PASSWORD'),
database: nconf.get('MAINDB_DATABASE'),
host: nconf.get('MAINDB_HOST'),
port: nconf.get('MAINDB_PORT'),
dialect: nconf.get('MAINDB_DIALECT'),
migrationStorageTableName: "sy_sequelize_meta",
ssl: useSSL,
dialectOptions: {
ssl: useSSL
},
},
};