ef-migrations
Add and apply EF Core migrations against BookingDbContext, including the one-time switch off EnsureCreated() so migrations own the schema.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Add and apply EF Core migrations against BookingDbContext, including the one-time switch off EnsureCreated() so migrations own the schema.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Launch the full Zach Hair Studio stack locally — the .NET API plus the Next.js frontends — for development and manual verification.
Scaffold a new backend feature mirroring the Features/Bookings pattern (entity, DTOs, mappers, DbSet, controller) plus a starter Next.js page.
Regenerate a typed TypeScript API client for the Next.js frontends from the .NET OpenAPI document, keeping OpenAPI as the source of truth.
| name | ef-migrations |
| description | Add and apply EF Core migrations against BookingDbContext, including the one-time switch off EnsureCreated() so migrations own the schema. |
Manages EF Core 10 migrations for BookingDbContext
(API/ZachHairStudio.Shared/Db/BookingDbContext.cs), with the API project
(API/ZachHairStudio.Api) as the startup project.
dotnet-ef tool must match EF Core 10. The environment currently has
9.0.15, which is too old. Update once:
dotnet tool update --global dotnet-ef --version "10.*"
(or add a local tool manifest: dotnet new tool-manifest +
dotnet tool install dotnet-ef --version "10.*").The API currently builds the schema with db.Database.EnsureCreated() in
API/ZachHairStudio.Api/Program.cs. Migrations and EnsureCreated() don't mix.
Before the first migration:
db.Database.EnsureCreated(); with db.Database.Migrate();.Data/bookings.db created by EnsureCreated() (dev data
only) so the initial migration applies cleanly.From the repo root (Shared holds the context, Api is the startup project):
dotnet ef migrations add <Name> \
--project API/ZachHairStudio.Shared \
--startup-project API/ZachHairStudio.Api
dotnet ef database update \
--project API/ZachHairStudio.Shared \
--startup-project API/ZachHairStudio.Api
(dotnet run also applies them automatically once Program.cs uses
Migrate().)
Migrations/ folder appears under API/ZachHairStudio.Shared.dotnet ef database update succeeds and bookings.db has the new schema
(inspect with the sqlite MCP server).