db: Foreign Keys für blocker- und Tageseintrag-Verweise (Migration 0017)
Bisher reine uuid-Spalten ohne referenzielle Integritaet -> Orphan-Risiko, wenn das Ziel geloescht wird. Jetzt echte FKs mit ON DELETE SET NULL: - day_entry.blocker_id -> blocker - blocker.area_id -> area - blocker.project_id -> project Migration bereinigt vorab verwaiste IDs (UPDATE ... SET NULL), damit ADD CONSTRAINT auf Altdaten nicht bricht. Verifiziert: alle 18 Migrationen laufen gegen frische Postgres 16 durch, FKs angelegt. (todo.bezug_id / time_entry.bezug_id bleiben FK-frei: echt polymorph ueber bezug_kind project/deal/campaign — kein einzelner FK moeglich.) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
ff0a15b94e
commit
9bae1702aa
4 files changed
+3362
-3
No files matched your search
File diff suppressed because it is too large.
Load diff
@@ -120,6 +120,13 @@
|
||||
"when": 1780771242601,
|
||||
"tag": "0016_project_logo_url",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 17,
|
||||
"version": "7",
|
||||
"when": 1780826387755,
|
||||
"tag": "0017_rare_oracle",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user