LMS Migrations and Seeding
Summary
Source-backed migration inventory, design-time support, startup behavior, and seeding reference.
Audience
Engineering, QA, support, architecture, security, and release reviewers.
Reference Content
The repository contains one authored migration, one generated designer, and one current model snapshot. The migration materializes 19 persisted objects, 38 indexes, five foreign keys, and five cascade delete rules. Its generated rollback method removes the model objects, but no tested rollback procedure or production rollback ownership was found.
A design-time DbContext factory exists. Its connection-source and fallback details are intentionally excluded. Runtime migration and development seeding occur only inside a development-environment startup branch and can be skipped by an environment control. Production automatic migration behavior is not implemented in this Program.
Development seeding uses filter bypass with explicit tenant predicates, creates representative catalog/workflow records, and checks known state before adding missing records. It is partly idempotent rather than a general reconciliation engine. Seed personal/content values and environment configuration are intentionally excluded.
Source References
microservices/src/training-service/Program.csmicroservices/src/training-service/Infrastructure/Persistence.csmicroservices/src/training-service/Infrastructure/DevelopmentSeeder.csmicroservices/src/training-service/Infrastructure/Migrations/20260708143457_InitialTrainingSchema.csmicroservices/src/training-service/Infrastructure/Migrations/TrainingDbContextModelSnapshot.cs
Related Articles
See Also
Keywords
- LMS database
- Training persistence
- Source-backed model
Revision Information
- Status: Draft
- Last reviewed: 2026-07-17
- Review cycle: Quarterly