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`;