-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsequelize_config.js
49 lines (47 loc) · 1.36 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
47
48
49
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,
},
},
};