add-entity

Installation
SKILL.md

Add Database Entity

Create entity for $ARGUMENTS.

Steps

  1. Read the pattern: Open packages/server/api/src/app/tables/table/table.entity.ts as reference.

  2. Create entity file at packages/server/api/src/app/{module}/{name}.entity.ts:

    • Use EntitySchema (NOT decorators)
    • Include ...BaseColumnSchemaPart (id, created, updated)
    • Use ApIdSchema for foreign key columns ({ ...ApIdSchema, nullable: false })
    • Add projectId column + relation to project (CASCADE delete)
    • Add foreignKeyConstraintName on all join columns
    • Array columns: { type: String, array: true, nullable: false }
  3. Register entity: Import and add to getEntities() array in packages/server/api/src/app/database/database-connection.ts. This is REQUIRED — TypeORM does NOT auto-discover.

Installs
1
First Seen
Jul 15, 2026
add-entity — dexhunter/activepieces