Deploy database schema changes and regenerate EF Core entities to keep the C# model layer in sync with the database.
When to Use
Run /db-build-scaffold after you have finished editing SQL files in Neptune.Database/. Batch your SQL edits first, then run this once.
Steps
- •
Build and deploy the DACPAC to the local SQL Server:
codecd C:/git/sitkatech/neptune/Build && powershell.exe -ExecutionPolicy Bypass -File DatabaseBuild.ps1
- •Must run from the
Build/directory so PowerShell module imports resolve correctly. - •If the build fails, report the error and stop.
- •Must run from the
- •
Scaffold EF Core entities from the updated database:
codecd C:/git/sitkatech/neptune/Build && powershell.exe -ExecutionPolicy Bypass -File Scaffold.ps1
- •This regenerates files in
Neptune.EFModels/Entities/Generated/. - •If the scaffold fails, report the error and stop.
- •This regenerates files in
- •
Report what changed by running:
codegit diff --stat Neptune.EFModels/Entities/Generated/
Summarize the regenerated entity files so the user knows what was updated.
Notes
- •Both scripts must be run from the
Build/directory — they use relative module imports that fail from other directories. - •After this skill completes, you will typically also need to run
/codegenif the schema changes affect API DTOs or endpoints. - •Generated files in
Neptune.EFModels/Entities/Generated/should not be edited directly — they are overwritten by the scaffold.