From 9dda78b28aaf0d0a449b0b2ec38e23c08b45bf0c Mon Sep 17 00:00:00 2001 From: Gulum Date: Sat, 6 Jun 2026 18:05:15 +0200 Subject: [PATCH] DB-3: EF Migrations Drift-Check in CI (has-pending-model-changes) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Nach dem Build-Schritt in test-backend: dotnet-ef 10.0.* global installieren, dann `dotnet ef migrations has-pending-model-changes` ausführen. Schlaegt fehl wenn Code-Änderungen an Entities/OnModelCreating keine passende Migration haben. Fängt genau den Drift, den der SQLite-EnsureCreated-Testhost nicht sieht. --- .gitea/workflows/ci.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 077109e..866fa9b 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -48,6 +48,19 @@ jobs: - name: Build run: dotnet build GerbilManager.slnx --no-restore -c Release + - name: dotnet-ef Tool installieren + run: dotnet tool install --global dotnet-ef --version 10.0.* + + - name: DB-3 EF Migrations Drift-Check + # Fails CI if the EF model diverges from the snapshot (i.e. a code change touched + # entities/OnModelCreating without generating a matching migration). Catches exactly + # the class of drift the SQLite/EnsureCreated test host is blind to. + run: > + dotnet ef migrations has-pending-model-changes + --project GerbilManagerWebAPI + --startup-project GerbilManagerWebAPI + --no-build -c Release + - name: Tests ausfuehren run: dotnet test GerbilManager.slnx --no-build -c Release --logger "console;verbosity=normal"