Skip to main content

Payroll Migrations and Seeding

Summary

Verified migration history, current snapshot, startup application, and development seeding.

Audience

Payroll developers, QA and support engineers, solution and security architects, and implementation partners.

Reference Content

The sections below describe the confirmed logical storage contract and its implementation boundaries.

Purpose

Inventory model evolution and startup initialization without publishing migration SQL or configuration values.

Ownership

Payroll Service owns four EF migrations and the current PayrollDbContext model snapshot.

Lifecycle

  • 20260703065402_InitialPayrollFoundation established the initial 18-object foundation and its initial indexes.
  • 20260703071207_AddPayrollCalculationFields extended Payroll run details with employee calculation inputs/outcomes.
  • 20260703073048_AddPayrollLifecycleFreeze added run/detail freeze state, employee/effective component scope, recovery linkage, related indexes, and outbox persistence.
  • 20260703103304_AddApprovedExpenseSnapshot added the approved-expense projection and its two indexes.

At web-host startup, migrations run unless hosting configuration suppresses them. In the development environment, seeding then attempts to add local verification profiles and period/input examples; a seeding failure is logged and does not prevent continued startup after migrations.

Persisted fields

Migration files describe model evolution; the current snapshot is the authoritative generated representation of the configured EF model. This page deliberately omits physical schema, SQL, configuration names/values, and seed data.

Relationships

No migration in the current history creates a foreign key.

Constraints

Migration ordering is timestamped. Startup suppression exists, but deployment approval and rollback policy are not represented in source.

Indexes

The initial migration established the original index set; lifecycle and expense migrations adjusted/added indexes. The current snapshot confirms 23 explicit indexes.

Tenant behavior

Seed helpers use filter bypass with explicit tenant predicates to avoid duplicate local records.

Audit behavior

Development seeding itself does not establish a production migration audit trail.

Integration usage

Backfill is separate from EF migration and development seeding; it is invoked as a dedicated process and does not start the web host.

Known limitations

No repository evidence confirms production orchestration, approval gates, backups, or rollback execution.

Requires confirmation

  • Production migration owner, sequencing, backup, rollback, and verification procedure.
  • Whether development seeding is prohibited by deployment policy outside local development.

Source References

  • microservices/src/payroll-service/Infrastructure/PayrollDbContext.cs
  • microservices/src/payroll-service/Domain/PayrollEntities.cs
  • microservices/src/payroll-service/Infrastructure/Migrations/PayrollDbContextModelSnapshot.cs
  • microservices/src/payroll-service/Program.cs
  • microservices/src/payroll-service/Infrastructure/DevelopmentSeeder.cs
  • microservices/src/payroll-service/Infrastructure/Migrations/20260703065402_InitialPayrollFoundation.cs
  • microservices/src/payroll-service/Infrastructure/Migrations/20260703071207_AddPayrollCalculationFields.cs
  • microservices/src/payroll-service/Infrastructure/Migrations/20260703073048_AddPayrollLifecycleFreeze.cs
  • microservices/src/payroll-service/Infrastructure/Migrations/20260703103304_AddApprovedExpenseSnapshot.cs

See Also

Keywords

  • Payroll database
  • Payroll Migrations and Seeding
  • Payroll persistence

Revision Information

  • Status: Draft
  • Last reviewed: 2026-07-15
  • Review cycle: Quarterly