mcpField
D
d1-05-entity-migration

d1-05-entity-migration

github.com/softinter-chiangraiData & databases046 installsUpdated 9w ago
Repository

About d1-05-entity-migration

A skill for defining an entity in `up-api` and creating its database migration. It takes the requested entity and columns as specified, then updates the running Postgres database without redeploying.

Key features

  1. 01Collect entity name and columns
  2. 02Add entity to `AppDbContext`
  3. 03Create and apply EF migration
  4. 04Verify the database table

Use cases

  1. 01Add a specified entity to `up-api`
  2. 02Update the running database schema without redeploying

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/softinter-chiangrai/up-ai-skill-training --skill d1-05-entity-migration

After installing, type/d1-05-entity-migrationin Claude Code to confirm it loaded.

Details

From the project README

Day 1 · Step 5 — Entity + migration (no redeploy)

Before starting: Ask for:

  1. Entity name (PascalCase, e.g., Product, Order, User) — REQUIRED
  2. Columns (format: ColumnName:Type, comma-separated, e.g., Name:string, Price:decimal, Stock:int) — REQUIRED
  3. Nullable columns (optional, default: all non-string/Id are non-nullable) — OPTIONAL

Use exactly as specified. Do not suggest, add, or modify columns.

up-api/Entities/<Entity>.cs:

public class <Entity>
{
    public int Id { get; set; }
    // one property per given column, e.g.:
    // public string Name { get; set; } = string.Empty;
    // public decimal Price { get; set; }
}

Add to AppDbContext:

public DbSet<<Entity>> <Entity>s => Set<<Entity>>();
cd up-api
dotnet ef migrations add Init<Entity>
dotnet ef database update

This runs against the already-running Postgres container via the localhost:5432 connection string from the db-config step — no redeploy needed. Verify the table exists (\dt in psql, or a quick docker exec into the db container).

Comments

Markdown supported