Leave Migrations and Seeding
Summary
Three EF Core migrations create the 12-object Leave model, extend the Employee projection, and add Workflow correlation.
Audience
Backend developers, QA, architects, DevOps engineers, and migration reviewers.
Reference Content
| Sequence | Migration | Verified purpose | Source |
|---|---|---|---|
| 1 | InitialLeaveService | Creates the Leave-owned schema, 12 objects, primary keys, and 14 indexes | microservices/src/leave-service/Infrastructure/Migrations/20260702162726_InitialLeaveService.cs |
| 2 | AddEmployeeProfileSyncFields | Adds projection synchronization/organization fields and one index | microservices/src/leave-service/Infrastructure/Migrations/20260703060858_AddEmployeeProfileSyncFields.cs |
| 3 | AddLeaveWorkflowInstance | Adds optional request Workflow correlation and one index | microservices/src/leave-service/Infrastructure/Migrations/20260706172733_AddLeaveWorkflowInstance.cs |
The current model snapshot represents 12 objects and 16 indexes. Startup applies pending migrations unless an environment-controlled suppression is active; the exact setting name is intentionally omitted. In Development, the service attempts idempotent seed initialization after migration. The seeder contains synthetic local profiles, Leave configuration, calendar, balance, request, and timeline data; those values are intentionally not reproduced.
No dedicated backfill, reconciliation migration, data-copy runner, or documented zero-downtime rollback mechanism exists for Leave. Each migration has a generated Down method, but that does not by itself establish a safe production rollback plan. Review should compare model, snapshot, provider-generated migration, compatibility effects, tenant behavior, locking/data-volume risk, and recovery evidence before approval. This guide does not provide production commands or destructive SQL.
Source References
- microservices/src/leave-service/Infrastructure/Migrations/20260702162726_InitialLeaveService.cs
- microservices/src/leave-service/Infrastructure/Migrations/20260703060858_AddEmployeeProfileSyncFields.cs
- microservices/src/leave-service/Infrastructure/Migrations/20260706172733_AddLeaveWorkflowInstance.cs
- microservices/src/leave-service/Infrastructure/Migrations/LeaveDbContextModelSnapshot.cs
- microservices/src/leave-service/Infrastructure/DevelopmentSeeder.cs
- microservices/src/leave-service/Program.cs
Related Articles
See Also
Keywords
- EF migration
- Model snapshot
- Development seed
Revision Information
- Status: Draft
- Last reviewed: 2026-07-15
- Review cycle: Quarterly