feat(migration): settings migration from old app all is now in the new app

This commit is contained in:
2025-11-24 15:22:12 -06:00
parent 90920e8fba
commit 40bc19aa6f
6 changed files with 248 additions and 110 deletions

View File

@@ -3,16 +3,14 @@ process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
import { toNodeHandler } from "better-auth/node";
import cors from "cors";
import express from "express";
import fs from "fs";
import { createServer } from "http";
import { createProxyMiddleware, fixRequestBody } from "http-proxy-middleware";
import { createProxyMiddleware } from "http-proxy-middleware";
import morgan from "morgan";
import os from "os";
import { dirname, join } from "path";
import swaggerJsdoc from "swagger-jsdoc";
import swaggerUi from "swagger-ui-express";
import { fileURLToPath } from "url";
import { userMigrate } from "./src/internal/auth/controller/userMigrate.js";
import { schedulerManager } from "./src/internal/logistics/controller/schedulerManager.js";
import { setupMobileRoutes } from "./src/internal/mobile/route.js";
import { printers } from "./src/internal/ocp/printers/printers.js";
@@ -22,6 +20,7 @@ import { baseSettings } from "./src/internal/system/controller/settings/baseSett
import {
addListeners,
manualFixes,
settingsMigrate,
} from "./src/internal/system/utlis/addListeners.js";
import { swaggerOptions } from "./src/pkg/apiDocs/swaggerOptions.js";
import { auth } from "./src/pkg/auth/auth.js";
@@ -77,6 +76,7 @@ const main = async () => {
}
// connect to the prod sql
console.log("Connecting to the sql server");
await initializeProdPool();
// express app
@@ -218,11 +218,16 @@ const main = async () => {
v1Listener();
addListeners();
//userMigrate();
// some temp fixes
// above 230 remove these
manualFixes();
settingsMigrate();
}, 5 * 1000);
// setTimeout(() => {
// startHonoServer();
// }, 8 * 1000);
// start the server up
server.listen(PORT, "0.0.0.0", () =>
log.info(