mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-11 17:27:31 +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
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
// Script utilitaire pour créer une nouvelle migration
|
||||
// Usage: node scripts/create-migration.js "nom de la migration"
|
||||
|
||||
import { createMigration } from '../server/migrations.js';
|
||||
|
||||
const migrationName = process.argv[2];
|
||||
|
||||
if (!migrationName) {
|
||||
console.error('❌ Usage: node scripts/create-migration.js "nom de la migration"');
|
||||
console.error(' Exemple: node scripts/create-migration.js "add user roles table"');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
try {
|
||||
const filePath = createMigration(migrationName);
|
||||
console.log(`✅ Migration créée avec succès: ${filePath}`);
|
||||
console.log(' Éditez ce fichier pour ajouter votre SQL');
|
||||
} catch (error) {
|
||||
console.error('❌ Erreur lors de la création de la migration:', error);
|
||||
process.exit(1);
|
||||
}
|
||||
Reference in new issue
Block a user