diff --git a/.replit b/.replit index 758bc01..2e1a3ae 100644 --- a/.replit +++ b/.replit @@ -37,4 +37,4 @@ args = "npm run dev" waitForPort = 5000 [agent] -integrations = ["javascript_database==1.0.0", "javascript_log_in_with_replit==1.0.0", "javascript_object_storage==1.0.0"] +integrations = ["javascript_object_storage==1.0.0", "javascript_database==1.0.0", "javascript_log_in_with_replit==1.0.0"] diff --git a/attached_assets/{71CBA732-C237-42CE-B37A-8F09149CD67B}_1756906573126.png b/attached_assets/{71CBA732-C237-42CE-B37A-8F09149CD67B}_1756906573126.png new file mode 100644 index 0000000..2a57252 Binary files /dev/null and b/attached_assets/{71CBA732-C237-42CE-B37A-8F09149CD67B}_1756906573126.png differ diff --git a/attached_assets/{73B77BF4-B744-4FAB-ACFC-0C80F04953D9}_1756906652566.png b/attached_assets/{73B77BF4-B744-4FAB-ACFC-0C80F04953D9}_1756906652566.png new file mode 100644 index 0000000..7999099 Binary files /dev/null and b/attached_assets/{73B77BF4-B744-4FAB-ACFC-0C80F04953D9}_1756906652566.png differ diff --git a/fix-webhook-bap.sql b/fix-webhook-bap.sql new file mode 100644 index 0000000..5eb1066 --- /dev/null +++ b/fix-webhook-bap.sql @@ -0,0 +1,34 @@ +-- Script pour créer la table webhook_bap_config en production +-- À exécuter directement sur votre base PostgreSQL + +-- Créer la table +CREATE TABLE IF NOT EXISTS webhook_bap_config ( + id SERIAL PRIMARY KEY, + name VARCHAR(100) NOT NULL DEFAULT 'Configuration BAP', + webhook_url TEXT NOT NULL, + description TEXT, + is_active BOOLEAN NOT NULL DEFAULT true, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP +); + +-- Insérer la configuration par défaut +INSERT INTO webhook_bap_config (name, webhook_url, description, is_active) +VALUES ( + 'Configuration BAP', + 'https://workflow.ffnancy.fr/webhook-test/a3d03176-b72f-412d-8fb9-f920b9fbab4d', + 'Configuration par défaut pour l''envoi des fichiers BAP vers n8n', + true +) ON CONFLICT DO NOTHING; + +-- Créer la table de suivi des migrations +CREATE TABLE IF NOT EXISTS migrations ( + id SERIAL PRIMARY KEY, + filename VARCHAR(255) UNIQUE NOT NULL, + executed_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP +); + +-- Marquer la migration comme appliquée +INSERT INTO migrations (filename) +VALUES ('20250903141000_create_webhook_bap_config.sql') +ON CONFLICT DO NOTHING; \ No newline at end of file diff --git a/server/index.ts b/server/index.ts index bee0279..27ccf50 100644 --- a/server/index.ts +++ b/server/index.ts @@ -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); } }