Mediabibliotheek: module Media met eigen tabellen en geverifieerde kopie van de Hero-foto's (fase 1 van de migratie, standaard uit)
Continuous Integration / config-sls (pull_request) Successful in 10s
Continuous Integration / config-asf (pull_request) Successful in 7s
Continuous Integration / changes (pull_request) Successful in 20s
Continuous Integration / compile-sites (pull_request) Canceled after 0s
Continuous Integration / backend-test (pull_request) Canceled after 0s
Continuous Integration / vulnerability-scan (pull_request) Canceled after 0s
Continuous Integration / frontend-build (pull_request) Canceled after 0s
Continuous Integration / frontend-test (pull_request) Canceled after 0s
Continuous Integration / frontend-prepare (pull_request) Canceled after 27s
Continuous Integration / frontend-lint (pull_request) Canceled after 0s
Continuous Integration / publish-sls-test (pull_request) Canceled after 0s
Continuous Integration / publish-sls-production (pull_request) Canceled after 0s
Continuous Integration / deploy-sls-test (pull_request) Canceled after 0s
Continuous Integration / deploy-sls-production (pull_request) Canceled after 0s
Continuous Integration / publish-asf-test (pull_request) Canceled after 0s
Continuous Integration / deploy-asf-test (pull_request) Canceled after 0s
Continuous Integration / smoke-sls-test (pull_request) Canceled after 0s
Continuous Integration / smoke-asf-test (pull_request) Canceled after 0s
Continuous Integration / backend-build (pull_request) Canceled after 54s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-17 15:38:40 +01:00
co-authored by Claude Sonnet 5.5
parent fc9417f752
commit 150c156fd7
25 changed files with 1304 additions and 8 deletions
@@ -64,10 +64,26 @@ The migration job compares and **aborts** (rolls its transaction back) on any di
3. Back-up first (above), on the test host too.
4. Deploy with the setting **off**, check the verification result in the log, then switch it on, then the smoke test (hero markers, `/theme-init.js`, a sample of media addresses), then Bryan checks the admin.
## What is built first (next step, when this plan is accepted)
## Status (2026-11-17): phase 1 (expand) is built, behind a setting that is OFF
1. A new module `SlpModularCms.Modules.Media` with its own `DbContext`, the tables `MediaAssets` and `MediaUses` and an additive EF migration (no existing table touched), with tests.
2. The copy-and-verify job (idempotent, safe to run twice) behind a setting; unit and in-memory tests, and a test against MariaDB.
3. The library reading from the new tables behind `Media:Library:ReadFromLibrary` (default off).
Built on `feature/media-library-screen`, not yet deployed anywhere:
Nothing in steps 1 to 3 runs without the setting, so a deploy of that code alone changes no data except the new, empty tables.
- New module `SlpModularCms.Modules.Media` (own `MediaDbContext`, tables `MediaAssets` and `MediaUses`, additive migration `InitialCreate`; no existing table is touched). It is referenced by the three hosts, so a deploy of this code creates the two empty tables at start-up and nothing else.
- `IMediaMigrationSource` (Core) and `HeroMediaMigrationSource` (Hero, read-only): the hero's photos (also those in the trash) and slides with their own ids, hashes and set hashes.
- `MediaLibraryCopier`: copies and **verifies** (counts, ids, hash, key, size, set hash) in one transaction; any difference or error rolls the whole copy back and nothing is left. It MIRRORS the source, so running it again gives the same result; rows of other modules are not touched.
- The copy runs only when `Media__Library__CopyOnStartup=true` (default **false**) and a failure is logged, never fatal.
- Tested in memory and against a real MariaDB (migration, copy twice, rollback on a failing copy).
Nothing reads from the new tables yet (phase 2, the switch, is not built). The library screen still reads the hero through the usage provider.
### Roll-out on TEST (needs SLS-Main to be told first)
1. Back-up (database dump and media listing) as above.
2. Deploy the branch with `Media__Library__CopyOnStartup` unset: the two empty tables appear; check the log for the Media migration.
3. Set `Media__Library__CopyOnStartup=true` and restart: the log says `Media library copy verified: N photos and M uses from hero` (or the error and the rollback).
4. Rollback at any point: set it back to false (the tables stay, unused) or drop `MediaUses` and `MediaAssets`.
5. Never on production.
### Still to build (phases 2 and 3)
The switch (`Media:Library:ReadFromLibrary`, dual write of new uploads, library reading from the new tables) and the contract phase. They need Bryan's acceptance of the copy on test first.