diff --git a/backend/utils/sequelize.js b/backend/utils/sequelize.js index 8e0b227..0b36dae 100644 --- a/backend/utils/sequelize.js +++ b/backend/utils/sequelize.js @@ -695,6 +695,22 @@ const syncModelsAlways = async (models) => { continue; } + // Für Tabellen mit problematischen ENUM-Änderungen - wenn Tabelle existiert, überspringe Sync + // Sequelize generiert fehlerhaftes SQL bei ENUM-Änderungen mit Kommentaren + const enumProblemTables = ['TaxiMapTileHouse']; + if (enumProblemTables.includes(model.name) && tableExists) { + console.log(` ℹ️ ${model.name} Tabelle existiert bereits - überspringe Sync (ENUM-Änderungen problematisch)`); + // Restore associations before continuing + if (associationKeys.length > 0) { + model.associations = originalAssociations; + } + // Restore virtual fields + for (const [key, attr] of Object.entries(virtualFields)) { + model.rawAttributes[key] = attr; + } + continue; + } + // Verwende syncModelWithTimeout für große Tabellen const syncSuccess = await syncModelWithTimeout(model, 60000); if (!syncSuccess) {