mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-21 14:08:15 +02:00
Automate database migration execution on production startup
Add logic to run database migrations automatically when the application starts in production. Includes a new migration script to create the webhook_bap_config table and a utility script for creating new migration files. Replit-Commit-Author: Agent Replit-Commit-Session-Id: cfbfe47c-0c9a-4ebf-8a41-2937407eccff Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/cfbfe47c-0c9a-4ebf-8a41-2937407eccff/baXszB8
This commit is contained in:
1 parent
49a5d6cf2b
commit
bae218813b
4 files changed
+183
No files matched your search
@@ -2,6 +2,19 @@ import express, { type Request, Response, NextFunction } from "express";
|
||||
import { registerRoutes } from "./routes.js";
|
||||
import { setupVite, serveStatic } from "./vite.js";
|
||||
|
||||
// Run database migrations first
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
console.log('🔄 [STARTUP] Running database migrations...');
|
||||
try {
|
||||
const { runMigrations } = await import('./migrations.js');
|
||||
await runMigrations();
|
||||
console.log('✅ [STARTUP] Database migrations completed');
|
||||
} catch (error) {
|
||||
console.error('❌ [STARTUP] Database migrations failed:', error);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize weather system
|
||||
console.log('🌤️ [STARTUP] Initializing weather system...');
|
||||
const { initializeWeatherConfig } = await import('./weatherAutoConfig.js');
|
||||
|
||||
Reference in new issue
Block a user