Refs #13. New migrations job in docker-build.yml that protects every future schema change (and the prod cutover, server-management#481). Runs on every push/PR; for each provider:
Model-drift — dotnet ef migrations has-pending-model-changes fails if an entity changed without a matching migration (so a forgotten migration can't merge).
Apply-to-fresh — dotnet ef database update against a fresh empty DB applies all migrations in order, catching broken/un-orderable ones.
Providers
SQLite (prod provider): throwaway file (ETV_CONFIG_FOLDER=$(mktemp -d)), no service.
MySql: Startup uses ServerVersion.AutoDetect (connects at config time), so the job runs a services: mysql:8.4 container. Confirmed the runner (act_runner v0.6.1, Docker execution, network downloadswarm) supports services → reachable as mysql:3306. Connection via MySql__ConnectionString.
Validated locally against real DBs (before pushing)
Independent gate for now (not a needs: of the image build) so the new MySql-service dependency can't block image builds until it's proven on the runner. Promote to a required check / build dependency once green.
Docs: ci-cd.md → Migration integrity (dual-provider discipline, the non-transactional caveat) + a CLAUDE.md convention.
The migrations job's real-CI run here is the verification that the MySql services: container works on the runner.
Refs #13. New **`migrations`** job in `docker-build.yml` that protects every future schema change (and the prod cutover, server-management#481). Runs on every push/PR; for **each** provider:
1. **Model-drift** — `dotnet ef migrations has-pending-model-changes` fails if an entity changed without a matching migration (so a forgotten migration can't merge).
2. **Apply-to-fresh** — `dotnet ef database update` against a fresh empty DB applies *all* migrations in order, catching broken/un-orderable ones.
## Providers
- **SQLite** (prod provider): throwaway file (`ETV_CONFIG_FOLDER=$(mktemp -d)`), no service.
- **MySql**: `Startup` uses `ServerVersion.AutoDetect` (connects at config time), so the job runs a **`services: mysql:8.4`** container. Confirmed the runner (`act_runner v0.6.1`, Docker execution, network `downloadswarm`) supports services → reachable as `mysql:3306`. Connection via `MySql__ConnectionString`.
## Validated locally against real DBs (before pushing)
- SQLite: drift clean; **787 migrations → 139 tables**.
- MySql 8.4: drift clean; **305 migrations → 137 tables**.
(EF CLI pattern from `scripts/add-migration.sh`: `--startup-project ErsatzTV --project …{Sqlite|MySql} -- --provider {Sqlite|MySql}`.)
## Notes
- **Independent gate** for now (not a `needs:` of the image `build`) so the new MySql-service dependency can't block image builds until it's proven on the runner. Promote to a required check / build dependency once green.
- Docs: `ci-cd.md` → **Migration integrity** (dual-provider discipline, the non-transactional caveat) + a `CLAUDE.md` convention.
The `migrations` job's real-CI run here is the verification that the MySql `services:` container works on the runner.
New `migrations` job in docker-build.yml runs on every push/PR and, per provider:
- `dotnet ef migrations has-pending-model-changes` — fails on model drift (an entity
changed without a matching migration).
- `dotnet ef database update` against a fresh empty DB — applies all migrations,
catching broken/un-orderable ones.
SQLite (the prod provider) uses a throwaway file; MySql uses ServerVersion.AutoDetect
(connects at config time), so the job runs a `services: mysql:8.4` container (the
act_runner uses Docker execution on network downloadswarm, so the service is reachable
as `mysql:3306`). Independent gate for now (not a `needs:` of the image build) so the
MySql-service dependency can't block image builds until proven stable.
Validated both providers locally against real DBs: SQLite 787 migrations -> 139 tables;
MySql 8.4 305 migrations -> 137 tables; both model-drift checks clean.
Docs: ci-cd.md "Migration integrity" (dual-provider discipline, EF CLI pattern, the
non-transactional caveat) + CLAUDE.md convention.
Refs #13
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
timothy
merged commit 307da32f34 into main2026-06-27 11:05:00 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Refs #13. New
migrationsjob indocker-build.ymlthat protects every future schema change (and the prod cutover, server-management#481). Runs on every push/PR; for each provider:dotnet ef migrations has-pending-model-changesfails if an entity changed without a matching migration (so a forgotten migration can't merge).dotnet ef database updateagainst a fresh empty DB applies all migrations in order, catching broken/un-orderable ones.Providers
ETV_CONFIG_FOLDER=$(mktemp -d)), no service.StartupusesServerVersion.AutoDetect(connects at config time), so the job runs aservices: mysql:8.4container. Confirmed the runner (act_runner v0.6.1, Docker execution, networkdownloadswarm) supports services → reachable asmysql:3306. Connection viaMySql__ConnectionString.Validated locally against real DBs (before pushing)
(EF CLI pattern from
scripts/add-migration.sh:--startup-project ErsatzTV --project …{Sqlite|MySql} -- --provider {Sqlite|MySql}.)Notes
needs:of the imagebuild) so the new MySql-service dependency can't block image builds until it's proven on the runner. Promote to a required check / build dependency once green.ci-cd.md→ Migration integrity (dual-provider discipline, the non-transactional caveat) + aCLAUDE.mdconvention.The
migrationsjob's real-CI run here is the verification that the MySqlservices:container works on the runner.