mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-11 17:26:45 +02:00
feat(db): Add automated safe migration on startup
This commit is contained in:
1 parent
60e89cb2bf
commit
4c06e5951d
6 files changed
+1283
-27
No files matched your search
@@ -11,6 +11,7 @@ import { setupVite, serveStatic, log } from "./vite";
|
||||
import { schedulerService } from "./services/scheduler";
|
||||
import { ensureAdminUserExists } from "./init-admin";
|
||||
import { startTokenCron } from "./cron";
|
||||
import { migrate } from "./migrate";
|
||||
|
||||
const app = express();
|
||||
const PgSession = connectPgSimple(session);
|
||||
@@ -147,6 +148,9 @@ app.use((req, res, next) => {
|
||||
});
|
||||
|
||||
(async () => {
|
||||
// Run database migration first
|
||||
await migrate();
|
||||
|
||||
const server = await registerRoutes(app);
|
||||
|
||||
app.use((err: any, _req: Request, res: Response, _next: NextFunction) => {
|
||||
|
||||
Reference in new issue
Block a user