BitzOrcas uses SqlSugar CodeFirst for schema management instead of traditional EF Core migrations. Tables are created/updated from entity definitions, not from migration files.
Schema initialization modes
# Create/update schema + seed demo datadotnet run --project src/Hosts/BitzOrcas.Api -- --init-schema --seed-demo
# Schema only (no seed data)dotnet run --project src/Hosts/BitzOrcas.Api -- --init-schema
# Seed data only (schema must already exist)dotnet run --project src/Hosts/BitzOrcas.Api -- --seed-only
# No schema init (default — enter web pipeline)dotnet run --project src/Hosts/BitzOrcas.ApiWhat —init-schema does
- Reads
PersistenceModelRegistryfor all registered entities - Calls
SqlSugar CodeFirstto create/update tables - Creates indexes defined in entity metadata
- Creates audit tables (7 sharded tables)
- Creates CAP Outbox tables
- Exits without entering the web pipeline
What —seed-demo does
ISeedRunnerdiscovers allISeedStepimplementations- Executes steps in dependency order
- Each step reads CSV via
CsvSeedReader - Upserts via SqlSugar
Storageable(safe to re-run) - Produces a
SeedRunReportwith counts
Production considerations
- Back up database before running
--init-schemaon existing data - Schema changes are additive-safe but may drop removed columns
- Seed data is idempotent (Storageable upsert)
See also
- Demo accounts — Seed data reference
- Persistence building block — SqlSugar configuration