chore(dbconfig): cleanup imports, add checks to see if we're in test env

This commit is contained in:
parent 6fd6d7cbb1
commit 655e9c5e07
Signed by: tablet
GPG Key ID: 924A5F6AF051E87C

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