From 7aa103948241721a0026cdffa6b24772cff1155d Mon Sep 17 00:00:00 2001 From: Aminejv Date: Mon, 9 Aug 2021 16:41:31 +0100 Subject: [PATCH] chore(env): update knex config to match NODE_ENV values --- knexfile.js | 49 +++++++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/knexfile.js b/knexfile.js index 3a691362..4d12083d 100644 --- a/knexfile.js +++ b/knexfile.js @@ -1,26 +1,31 @@ import * as Environment from "~/node_common/environment"; -module.exports = { - development: { - client: "pg", - connection: { - ssl: true, - port: 5432, - host: Environment.POSTGRES_HOSTNAME, - database: Environment.POSTGRES_DATABASE, - user: Environment.POSTGRES_ADMIN_USERNAME, - password: Environment.POSTGRES_ADMIN_PASSWORD, - }, - }, - production: { - client: "pg", - connection: { - ssl: true, - port: 5432, - host: Environment.POSTGRES_HOSTNAME, - database: Environment.POSTGRES_DATABASE, - user: Environment.POSTGRES_ADMIN_USERNAME, - password: Environment.POSTGRES_ADMIN_PASSWORD, - }, +const developmentConfig = { + client: "pg", + connection: { + ssl: true, + port: 5432, + host: Environment.POSTGRES_HOSTNAME, + database: Environment.POSTGRES_DATABASE, + user: Environment.POSTGRES_ADMIN_USERNAME, + password: Environment.POSTGRES_ADMIN_PASSWORD, }, }; + +const productionConfig = { + client: "pg", + connection: { + ssl: true, + port: 5432, + host: Environment.POSTGRES_HOSTNAME, + database: Environment.POSTGRES_DATABASE, + user: Environment.POSTGRES_ADMIN_USERNAME, + password: Environment.POSTGRES_ADMIN_PASSWORD, + }, +}; + +module.exports = { + development: developmentConfig, + staging: productionConfig, + production: productionConfig, +};