From 9bc1260bc00f4171c69feb49cadc0e7b27e6ef75 Mon Sep 17 00:00:00 2001 From: Mohamad Ihsan Date: Mon, 20 Feb 2023 22:13:50 +0700 Subject: [PATCH] update --- knexfile.js | 130 ++++++++++++++++++++++++++-------------------------- 1 file changed, 65 insertions(+), 65 deletions(-) diff --git a/knexfile.js b/knexfile.js index fc6533f..b10472b 100644 --- a/knexfile.js +++ b/knexfile.js @@ -1,4 +1,4 @@ -require("dotenv").config(); +require('dotenv').config(); let host; let database; @@ -6,77 +6,77 @@ let port; let user; let password; -if (process.env.SERVER_FOR == "local") { - host = "localhost"; - database = "postgres"; +if (process.env.SERVER_FOR == 'local') { + host = 'localhost'; + database = 'postgres'; port = 5432; - user = "postgres"; - password = "postgres"; -} else if (process.env.SERVER_FOR == "development") { - host = "10.20.14.14"; - database = "postgres"; + user = 'postgres'; + password = 'postgres'; +} else if (process.env.SERVER_FOR == 'development') { + host = '10.20.14.14'; + database = 'postgres'; port = 5432; - user = "cms"; - password = "Cm5kc1#2021"; -} else if (process.env.SERVER_FOR == "production") { - host = "10.1.201.75"; - database = "postgres"; + user = 'postgres'; + password = 'inhc0mmute_cms'; +} else if (process.env.SERVER_FOR == 'production') { + host = '10.1.201.75'; + database = 'postgres'; port = 5432; - user = "postgres"; - password = "inhc0mmute_cms"; + user = 'postgres'; + password = 'inhc0mmute_cms'; } - module.exports = { - // development: { - // client: "pg", - // connection: process.env.DB_URL, - // migrations: { - // directory: "./infrastructure/database/migrations", - // }, - // seeds: { directory: "./infrastructure/database/seeds" }, - // }, - development: { - client: "pg", - connection: { - host: host, - database: database, - user: user, - password: password, - }, - // connection: process.env.DB_URL, - pool: { - min: 2, - max: 10, - }, - migrations: { - directory: "./infrastructure/database/migrations", - }, +module.exports = { + // development: { + // client: "pg", + // connection: process.env.DB_URL, + // migrations: { + // directory: "./infrastructure/database/migrations", + // }, + // seeds: { directory: "./infrastructure/database/seeds" }, + // }, + development: { + client: 'pg', + connection: { + host: host, + database: database, + user: user, + password: password, }, + // connection: process.env.DB_URL, + pool: { + min: 2, + max: 10, + }, + migrations: { + directory: './infrastructure/database/migrations', + }, + }, - testing: { - client: "pg", - connection: process.env.DB_URL, - migrations: { - directory: "./infrastructure/database/migrations", - }, - seeds: { directory: "./infrastructure/database/seeds" }, + testing: { + client: 'pg', + connection: process.env.DB_URL, + migrations: { + directory: './infrastructure/database/migrations', }, + seeds: { directory: './infrastructure/database/seeds' }, + }, - production: { - client: "pg", - connection: { - host: host, - database: database, - user: user, - password: password, - }, - // connection: process.env.DB_URL, - pool: { - min: 2, - max: 10, - }, - migrations: { - directory: "./infrastructure/database/migrations", - }, + production: { + client: 'pg', + connection: { + host: host, + database: database, + user: user, + password: password, }, - }; + // connection: process.env.DB_URL, + pool: { + min: 2, + max: 10, + }, + migrations: { + directory: './infrastructure/database/migrations', + }, + }, +};