refactor(db): migrate Gmail review decisions

Move creation ownership from startup reconciliation to an additive provider-aware migration. Preserve legacy decisions during downgrade and add the previously missing MariaDB table path.
This commit is contained in:
cesnimda
2026-08-30 16:48:32 +02:00
parent c094800c69
commit b425f1edc5
9 changed files with 106 additions and 18 deletions
+5 -2
View File
@@ -17,6 +17,8 @@ table. It does not attempt to delete the legacy reconciler wholesale.
the migration-owned set.
- Added `20260830121000_AdoptUserRuleSettingsSchema` and removed both provider startup-create paths
for the independent per-user rule-settings table.
- Added `20260830122000_AdoptGmailReviewDecisionsSchema`, removed the SQLite startup-create path,
and supplied the previously absent MariaDB table definition.
- Corrected the ownership runbook: new tables now default to migrations; the reconciler is legacy
compatibility code to retire one dependency group at a time.
@@ -35,14 +37,15 @@ migration.
- A database stopped immediately before the adoption migration, seeded with a representative SMTP
settings row, upgrades without changing that row.
- A representative per-user rules row survives adoption, downgrade, and re-upgrade.
- A representative Gmail review decision survives adoption, downgrade, and re-upgrade.
- Generated MariaDB SQL contains the provider-correct `SystemEmailSettings` DDL.
- Full backend: 723/723 passed after both leaf-table transfers.
- Full backend: 724/724 passed after all three leaf-table transfers.
- Fresh application startup over a new disposable SQLite database applied
`20260830120000_AdoptSystemEmailSettingsSchema` and reached the healthy listening state.
## Remaining JT-019 work
Thirty-three model tables remain startup-created, including the Identity group and several tables
Thirty-two 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.