From 71c44c3882e6307dcd13a4056f849faf27e02de8 Mon Sep 17 00:00:00 2001 From: "Gustavo S. de Paula" Date: Sun, 29 Mar 2020 17:51:47 -0300 Subject: [PATCH] make it better --- backend/src/database/connection.js | 8 +++++++- backend/src/database/db.test.sqlite | Bin 28672 -> 28672 bytes package.json | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/backend/src/database/connection.js b/backend/src/database/connection.js index e0746c2..b3b2a2c 100644 --- a/backend/src/database/connection.js +++ b/backend/src/database/connection.js @@ -1,7 +1,13 @@ const knex = require('knex') const configuration = require('../../knexfile') -const config = process.env.NODE_ENV == "test" ? configuration.test : configuration.development +let config = configuration.development + +if(process.env.NODE_ENV == "production") { + config = configuration.production +} else if (process.env.NODE_ENV == "test") { + config = configuration.test +} const connection = knex(config) diff --git a/backend/src/database/db.test.sqlite b/backend/src/database/db.test.sqlite index fbd473e53835fff8663a2a6447c03163f1f70155..d47ec84bb0b092ab62705f5e59e33c66f52a011e 100644 GIT binary patch delta 160 zcmZp8z}WDBae}lUKLY~;I}pPF$3z`tM*fWn9`cMVlUK@XvT1O;lxQ$dz9Fx|0%R6$ zQh3JC#v;zhY|1%#0-wkx0~P@`M*e*a{QEWwDs15wc3|X`6*pE^6l7pXv`jQKG%_}t re9_++sOAd;|Ch~z2Cw*KxS3@+VUoNciv_^8vjIug&4LN<`574ieN7;J delta 192 zcmZp8z}WDBae}lUI|Bm)2*Uu&L>*&B_KgW1@{CNASITR$skc6J)?l1`Ltcdi$h6<2 z@Qk00Nt}_{lymX~K9NlZECL)%{51^x`}k`%3knqQ3p+4z%8DB+D+)3&q$L?9rdgyW zPrm4{FYLew7dN*wOExtyGysYl19d-V;Qzw^e6ygzZGL$kW?4p