refactor(db): migrate cover letter history

Move append-only cover letter revisions into an additive provider-aware migration. Preserve manual and AI text, source metadata, ordering, and application cascade semantics.
This commit is contained in:
cesnimda
2026-08-30 18:55:20 +02:00
parent e933409698
commit 934b35a1e0
10 changed files with 137 additions and 47 deletions
+6 -2
View File
@@ -37,6 +37,8 @@ cohesive table groups. It does not attempt to delete the legacy reconciler whole
and historical compatibility bootstrap while retaining append-only results and usage counters.
- Added `20260830130000_AdoptApplicationChecklistSchema` for application workflow state, retaining
stable system keys, manual steps, completion state, and user ordering.
- Added `20260830131000_AdoptCoverLetterVersionSchema` for append-only document history, retaining
manual and AI-approved text plus source/action metadata.
- Corrected the ownership runbook: new tables now default to migrations; the reconciler is legacy
compatibility code to retire one dependency group at a time.
@@ -72,14 +74,16 @@ migration.
re-upgrade; deleting the parent application still cascades through its interaction history.
- Representative system-generated and manual checklist steps survive adoption, downgrade, and
re-upgrade; deleting the parent application still cascades through its workflow items.
- Representative manual and AI cover-letter revisions survive adoption, downgrade, and re-upgrade;
deleting the parent application still cascades through document history.
- Generated MariaDB SQL contains the provider-correct `SystemEmailSettings` DDL.
- Full backend: 732/732 passed after the application checklist transfer.
- Full backend: 733/733 passed after the cover-letter history transfer.
- Fresh application startup over a new disposable SQLite database applied
`20260830120000_AdoptSystemEmailSettingsSchema` and reached the healthy listening state.
## Remaining JT-019 work
Seventeen model tables remain startup-created, including the Identity group and several tables
Sixteen model tables remain startup-created, including the Identity group and several tables
with parent dependencies. Transfer them in small dependency-aware migrations with blank, populated,
retry and MariaDB runtime proof. Column/index repairs must remain until historical upgrade fixtures
prove each one redundant.