control sequelize logging with env variable

This commit is contained in:
Bilal Catic
2019-07-24 07:20:05 +02:00
parent 4fefa3a08d
commit ac1c82c16b
4 changed files with 21 additions and 17 deletions

18
config/config.js Normal file
View File

@@ -0,0 +1,18 @@
module.exports = {
development: {
username: 'docker',
password: 'docker',
database: 'CrmIntegration',
port: '5431',
dialect: 'postgres',
logging: parseInt(process.env.SEQUELIZE_LOGGING) ? console.log : false
},
test: {
"use_env_variable": 'DATABASE_URL',
logging: parseInt(process.env.SEQUELIZE_LOGGING) ? console.log : false
},
production: {
"use_env_variable": 'DATABASE_URL',
logging: parseInt(process.env.SEQUELIZE_LOGGING) ? console.log : false
}
};

View File

@@ -1,16 +0,0 @@
{
"development": {
"username": "docker",
"password": "docker",
"database": "CrmIntegration",
"port": "5431",
"dialect": "postgres",
"logging": false
},
"test": {
"use_env_variable": "DATABASE_URL"
},
"production": {
"use_env_variable": "DATABASE_URL"
}
}