From 655e9c5e07c334a7b7a8f413382113300a790a84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=99=E2=97=A6=20The=20Tablet=20=E2=9D=80=20GamerGirla?= =?UTF-8?q?ndCo=20=E2=97=A6=E2=9D=A7?= Date: Sat, 16 Mar 2024 21:21:46 -0400 Subject: [PATCH] chore(dbconfig): cleanup imports, add checks to see if we're in test env --- lib/dbconfig.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/dbconfig.ts b/lib/dbconfig.ts index 5f475a6..bcd8ae3 100644 --- a/lib/dbconfig.ts +++ b/lib/dbconfig.ts @@ -1,16 +1,13 @@ -import { resolve } from "path"; -import * as dotenv from "dotenv"; import mongoose from "mongoose"; const FUCKYOU = "/rockfic/abc-rockfic-v3"; -dotenv.config({ path: resolve("/home/rockfic/rockfic-staging/.env") }); -export const hasMigrated = false; -console.log("indbconfig"); +// dotenv.config({ path: resolve("/home/rockfic/rockfic-staging/.env") }); +export const hasMigrated = true; export const uri = - process.env.NODE_ENV === "production" + process.env.NODE_ENV === "production" && !process.env.TEST ? `mongodb://${process.env.DBUSER}:${process.env.DBPASS}@${process.env.DB}?authSource=admin` - : `mongodb://127.0.0.1/${process.env.DBNAME}?authSource=admin`; + : `mongodb://127.0.0.1/${process.env.DBNAME}`; export const olduri = - process.env.NODE_ENV === "production" + process.env.NODE_ENV === "production" && !process.env.TEST ? `mongodb://${process.env.DBUSER}:${process.env.DBPASS}@127.0.0.1:27017/rockfic_old?authSource=admin` : `mongodb://127.0.0.1/rockfic_old?authSource=admin`;