2023-10-12 23:04:25 -04:00
|
|
|
import { resolve } from "path";
|
2023-09-25 19:54:05 -04:00
|
|
|
import * as dotenv from "dotenv";
|
2023-12-28 06:21:37 -05:00
|
|
|
import mongoose from "mongoose";
|
2023-10-12 23:04:25 -04:00
|
|
|
const FUCKYOU = "/rockfic/abc-rockfic-v3";
|
2023-12-28 05:40:10 -05:00
|
|
|
dotenv.config({ path: resolve("/home/rockfic/rockfic-staging/.env") });
|
2023-12-30 17:43:28 -05:00
|
|
|
export const hasMigrated = false;
|
2023-12-28 05:57:16 -05:00
|
|
|
console.log("indbconfig");
|
2023-10-12 23:04:25 -04:00
|
|
|
export const uri =
|
2024-01-06 20:37:11 -05:00
|
|
|
process.env.NODE_ENV === "production"
|
|
|
|
? `mongodb://${process.env.DBUSER}:${process.env.DBPASS}@${process.env.DB}?authSource=admin`
|
|
|
|
: `mongodb://127.0.0.1/${process.env.DBNAME}?authSource=admin`;
|
2023-10-12 23:04:25 -04:00
|
|
|
export const olduri =
|
2024-01-06 20:37:11 -05:00
|
|
|
process.env.NODE_ENV === "production"
|
|
|
|
? `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`;
|
2023-12-28 06:21:37 -05:00
|
|
|
|
2023-12-30 15:58:14 -05:00
|
|
|
!mongoose.connection.modelNames().length && !hasMigrated && mongoose.connect(uri);
|