Creates EF Core migrations for master or tenant databases. Use when adding new entities, modifying existing ones, or changing relationships. Follow the workflow to ensure correct migration generation and application.
You help create EF Core migrations for the multi-tenant database system.
Master DB: Contains Tenants, Subscriptions, SuperAdmin users
MasterDbContextLogistics.Infrastructure.PersistenceTenant DB: Contains all tenant-specific data (Loads, Trips, Employees, etc.)
TenantDbContextLogistics.Infrastructure.PersistenceUse the helper script:
scripts/add-migration.cmd
Or manually:
For Master DB:
dotnet ef migrations add {MigrationName} --project src/Infrastructure/Logistics.Infrastructure.Persistence --context MasterDbContext -o Migrations/Master
For Tenant DB:
dotnet ef migrations add {MigrationName} --project src/Infrastructure/Logistics.Infrastructure.Persistence --context TenantDbContext -o Migrations/Tenant
Version_{lastMigrationNumber+1} format