mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-12 01:37:40 +02:00
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
23 lines
761 B
JavaScript
Executable File
23 lines
761 B
JavaScript
Executable File
#!/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);
|
|
} |