737 B
737 B
Backend Fix - Sync Model Changes
Problem
The backend was failing to start with a System.InvalidOperationException because the ZentralDbContext model had pending changes that were not captured in a migration.
Solution
- Created a new migration
SyncModelChangesto synchronize the database schema with the code.- Command:
dotnet ef migrations add SyncModelChanges --project Zentral.Infrastructure --startup-project Zentral.API
- Command:
- Updated the database.
- Command:
dotnet ef database update --project Zentral.Infrastructure --startup-project Zentral.API
- Command:
Status
- Create Migration
- Update Database
- Verify Backend Startup
The backend now starts correctly and listens on the configured port.