Add logging for model synchronization and cache handling in syncDatabase.js

Enhance sequelize.js by adding a console log to indicate when models are being synced without constraints. Update syncDatabase.js to include important notes on caching issues with Node.js ES-Modules and log the model loading process during deployment synchronization.
This commit is contained in:
Torsten Schulz (local)
2025-12-18 16:34:10 +01:00
parent bf0eed3b03
commit a0206dc8cb
2 changed files with 5 additions and 0 deletions

View File

@@ -210,6 +210,10 @@ const syncDatabase = async () => {
// Deployment-Synchronisation (immer Schema-Updates)
const syncDatabaseForDeployment = async () => {
try {
// WICHTIG: Bei Caching-Problemen das Script neu starten
// Node.js cached ES-Module, daher müssen Models neu geladen werden
console.log('📦 Lade Models neu (Node.js Module-Cache wird verwendet)...');
// Zeige den aktuellen Stage an
const currentStage = process.env.STAGE || 'nicht gesetzt';
console.log(`🚀 Starte Datenbank-Synchronisation für Deployment (Stage: ${currentStage})`);