| name | ef-migration |
| description | Create or modify an EF Core migration for PlaylistMiner database schema changes, with review and verification steps. |
EF Core Migration
Create a new migration after modifying entities or DbContext.
Steps
-
Verify changes:
git diff src/PlaylistMiner.Core/Models/
git diff src/PlaylistMiner.Infrastructure/Data/
-
Create migration (use descriptive name like AddVideoStatusColumn, CreateSearchIndexes):
dotnet ef migrations add <Name> --project src/PlaylistMiner.Infrastructure --startup-project src/PlaylistMiner.Api
-
Review generated migration — check for data loss, verify indexes (especially pg_trgm GIN indexes)
-
Apply locally:
dotnet ef database update --project src/PlaylistMiner.Infrastructure --startup-project src/PlaylistMiner.Api
-
Run integration tests to verify schema:
dotnet test tests/PlaylistMiner.IntegrationTests
Rollback
dotnet ef migrations remove
dotnet ef database update <PreviousMigration>