refactor(migration progress): moved to start looking at the go backedn

This commit is contained in:
2025-08-04 12:48:49 -05:00
parent a36552fd9b
commit a0179a41ba
15 changed files with 201 additions and 99 deletions

View File

@@ -1,16 +1,22 @@
import {db} from "../../../../database/dbclient.js";
import {settings} from "../../../../database/schema/settings.js";
import {createLog} from "../../logger/logger.js";
import { db } from "../../../../database/dbclient.js";
import { settings } from "../../../../database/schema/settings.js";
import { createLog } from "../../logger/logger.js";
import { serverSettings } from "../../server/controller/settings/getSettings.js";
export const prodSqlConfig = async () => {
try {
const serverSetting = await db.select().from(settings);
//const serverSetting = await db.select().from(settings);
const serverSetting = serverSettings as any;
// create dummy type data
const server = serverSetting.filter((s) => s.name === "dbServer");
const plantToken = serverSetting.filter((s) => s.name === "plantToken");
const dbUser = serverSetting.filter((s) => s.name === "dbUser");
const server = serverSetting.filter((s: any) => s.name === "dbServer");
const plantToken = serverSetting.filter(
(s: any) => s.name === "plantToken"
);
const dbUser = serverSetting.filter((s: any) => s.name === "dbUser");
// if erroring out double check the password was actually encoded before saving
const dbPassword = serverSetting.filter((s) => s.name === "dbPass");
const dbPassword = serverSetting.filter(
(s: any) => s.name === "dbPass"
);
const sqlConfig = {
server: server[0].value,
@@ -37,7 +43,9 @@ export const prodSqlConfig = async () => {
"info",
"lst",
"sqlProd",
`${JSON.stringify(error)} "There was an error getting/setting up the config for the prod sql server."`
`${JSON.stringify(
error
)} "There was an error getting/setting up the config for the prod sql server."`
);
}
};