refactor(db): migrate CV variant history

Move saved CVs and append-only revisions into an additive provider-aware migration. Preserve public slugs, builder settings, job-link nulling, and revision cascades.
This commit is contained in:
cesnimda
2026-08-30 17:28:35 +02:00
parent 778b365f9e
commit bc28893b6f
9 changed files with 206 additions and 92 deletions
+6 -2
View File
@@ -31,6 +31,8 @@ cohesive table groups. It does not attempt to delete the legacy reconciler whole
generated and manually edited content plus its `ON DELETE CASCADE` application relationship.
- Added `20260830127000_AdoptJobWorkspaceNotesSchema` for interview preparation and irregular AI
workspace results, retaining reviewed output and both application cascade relationships.
- Added `20260830128000_AdoptCvVariantSchema` for saved CVs and their append-only revision history,
retaining public slugs, builder settings, and job-link/version retention semantics.
- Corrected the ownership runbook: new tables now default to migrations; the reconciler is legacy
compatibility code to retire one dependency group at a time.
@@ -60,14 +62,16 @@ migration.
downgrade, and re-upgrade; deleting the parent application still deletes its draft.
- Representative interview-preparation and candidate-fit outputs survive adoption, downgrade, and
re-upgrade; deleting the parent application still deletes both cached note types.
- A representative CV and two saved revisions survive adoption, downgrade, and re-upgrade; deleting
its job clears only the optional link, while deleting the CV cascades through its revisions.
- Generated MariaDB SQL contains the provider-correct `SystemEmailSettings` DDL.
- Full backend: 729/729 passed after the job-workspace note transfer.
- Full backend: 730/730 passed after the CV variant and history transfer.
- Fresh application startup over a new disposable SQLite database applied
`20260830120000_AdoptSystemEmailSettingsSchema` and reached the healthy listening state.
## Remaining JT-019 work
Twenty-one model tables remain startup-created, including the Identity group and several tables
Nineteen 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.