Database
We use EF Core Code First to manage our database schema. So... Migrations it is.
Migrations
To auto-generate migrations for all database systems we support, run the following command:
dotnet ef migrations add
--output-dir Migrations
--startup-project ./src/Onyx.App/Onyx.App.Web/Onyx.App.Web.csproj
--project ./src/Onyx.Data/Onyx.Data.SQLite/
--context ApplicationDbContext
<MigrationName> -- --provider SQLite
dotnet ef migrations add
--output-dir Migrations
--startup-project ./src/Onyx.App/Onyx.App.Web/Onyx.App.Web.csproj
--project ./src/Onyx.Data/Onyx.Data.SqlServer/
--context ApplicationDbContext
<MigrationName> -- --provider SqlServer
Based on the solution directory
Make sure to replace the MigrationName with the name of your Migration (use CamelCase)
Last modified: 20 February 2025