refactor(db): migrate CV extraction data

Move upload artifacts and extraction runs into an additive provider-aware migration. Preserve parsed results, indexes, and nullable artifact retention semantics.
This commit is contained in:
cesnimda
2026-08-30 16:59:05 +02:00
parent 6c50e406b5
commit e28cc0ad47
9 changed files with 193 additions and 91 deletions
+6 -2
View File
@@ -25,6 +25,8 @@ cohesive table groups. It does not attempt to delete the legacy reconciler whole
- Added `20260830124000_AdoptEmailConnectionSchema` for Gmail, Microsoft Graph, and IMAP connection
records. Encrypted credentials and sync state are retained; scoped Gmail column repair and guarded
MariaDB index/identity repair remain for historical installations.
- Added `20260830125000_AdoptCvExtractionSchema` for upload artifacts and extraction runs, retaining
parsed output and the nullable `ON DELETE SET NULL` artifact relationship.
- Corrected the ownership runbook: new tables now default to migrations; the reconciler is legacy
compatibility code to retire one dependency group at a time.
@@ -48,14 +50,16 @@ migration.
and re-upgrade, and their indexes are present afterwards.
- Representative encrypted credentials for all three email providers survive adoption, downgrade,
and re-upgrade, and all five expected provider indexes are present afterwards.
- Representative CV artifact metadata and structured extraction output survive adoption, downgrade,
and re-upgrade; deleting the artifact preserves the run and clears its nullable relationship.
- Generated MariaDB SQL contains the provider-correct `SystemEmailSettings` DDL.
- Full backend: 726/726 passed after the email-provider connection transfer.
- Full backend: 727/727 passed after the CV extraction persistence transfer.
- Fresh application startup over a new disposable SQLite database applied
`20260830120000_AdoptSystemEmailSettingsSchema` and reached the healthy listening state.
## Remaining JT-019 work
Twenty-six model tables remain startup-created, including the Identity group and several tables
Twenty-four 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.