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

@@ -478,6 +478,7 @@ const syncModelsAlways = async (models) => {
try {
// constraints: false verhindert, dass Sequelize Foreign Keys automatisch erstellt
// Foreign Keys sollten nur über Migrations verwaltet werden
console.log(` 🔄 Syncing model ${model.name} with constraints: false`);
await model.sync({ alter: true, force: false, constraints: false });
} finally {
// Restore VIRTUAL fields after sync