mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-11 17:27:31 +02:00
Add database table and migration for BAP webhook configuration
Adds the `webhook_bap_config` table and a default configuration entry, along with a `migrations` table to track schema changes. Also includes a fix to prevent the application from exiting in production if database migrations fail during startup. 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/DPQVTPV
This commit is contained in:
1 parent
6d071aae07
commit
98089c6d41
5 files changed
+44
-9
No files matched your search
+9
-8
@@ -3,14 +3,15 @@ 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);
|
||||
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);
|
||||
// Ne pas arrêter l'app en développement
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user