- Modified the deployment workflow to include new migration paths for the backend, ensuring that migrations are correctly referenced in the deployment process. - Updated the `db:migrate` script in package.json to point to the `migrations-active` directory, enhancing clarity and organization of migration files. - Adjusted the deployment conditions to account for changes in migration file locations, improving the accuracy of change detection during deployments. - Removed obsolete migration files to streamline the migration process and prevent confusion.
1.5 KiB
Backend-Migrationen (Sequelize)
Aktive Migrationen
Neue Schema-Änderungen: nur noch Dateien unter migrations-active/. Ausführung z. B.:
npm run db:migrate (siehe backend/package.json, Pfad migrations-active).
Archiv
Ältere, bereits auf den Umgebungen ausgerollte Migrationen liegen unter migrations-archive/ und werden vom Sequelize-CLI nicht mehr ausgeführt.
Vor dem ersten Deploy nach dieser Aufteilung: fehlende Einträge in "SequelizeMeta" für die archivierten Dateinamen per SQL ergänzen, siehe sql/baseline-sequelize-meta-migrations-archive.sql (idempotent).
Sonstiges in diesem Ordner
SQL-Hilfsdateien und ältere Notizen verbleiben hier (werden nicht vom CLI geladen).
Falukant: Zertifikat und Produktionszählung
| Datei (Archiv) | Inhalt |
|---|---|
migrations-archive/20260402140000-add-certificate-productions-count-since.cjs |
Spalte falukant_data.falukant_user.certificate_productions_count_since (TIMESTAMPTZ, nullable) inkl. Kommentar. Setzt die DB-Grundlage dafür, dass Daemon, Backend und UI dieselbe Periode für „abgeschlossene Produktionen“ nutzen (Filter mit COALESCE(production_timestamp, production_date::timestamp) ab diesem Zeitpunkt; NULL = bisherige Historie). |
Eine parallele SQL-Migration im Daemon-Repository (z. B. 014_falukant_certificate_productions_count_since.sql) kann dieselbe Spalte anlegen, wenn das Deployment dort getrennt ist – Schema doppelt anlegen vermeiden.
Details zur Zähl- und Retention-Logik: docs/FALUKANT_PRODUCTION_CERTIFICATE.md.