feat(deploy): update deployment workflow and migration paths
Some checks failed
Deploy to production / deploy (push) Has been cancelled
Some checks failed
Deploy to production / deploy (push) Has been cancelled
- 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.
This commit is contained in:
@@ -1,12 +1,26 @@
|
||||
# Backend-Migrationen (Sequelize)
|
||||
|
||||
Migrationen in diesem Ordner werden mit dem Sequelize-CLI ausgeführt (Konfiguration siehe Projekt-Root / `backend`).
|
||||
## 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 | Inhalt |
|
||||
| Datei (Archiv) | Inhalt |
|
||||
|--------|--------|
|
||||
| `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). |
|
||||
| `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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user