ITSM/docs/adr/ADR-005-idempotente-migrati...

20 lines
872 B
Markdown
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ADR-005: Idempotente Schema-Migrationen statt Migrationstool
**Datum:** 2026-07-15 · **Status:** Akzeptiert
## Kontext
Bestehende Prod-DB (Flask-Ära) musste ohne Migrationsschritt weiterverwendet
werden; das Projekt hat genau eine schema.sql-Historie und wenige Releases.
## Entscheidung
`schema.sql` bleibt die einzige Quelle: CREATE TABLE IF NOT EXISTS +
ADD COLUMN IF NOT EXISTS + einmalige, selbstneutralisierende UPDATEs.
Wird beim App-Start per `include_str!` komplett ausgeführt (batch_execute).
## Konsequenzen
+ Kein Migrationstool, keine Versionstabelle, Deploy = Start.
+ Kompilierzeit-Einbettung: Binary und Schema sind untrennbar konsistent.
Destruktive Änderungen (DROP/RENAME) brauchen künftig explizite Sorgfalt
oder den Wechsel auf ein echtes Migrationstool — akzeptiert für die
aktuelle Projektgröße. Additiv-only ist Konvention.