generating-typeorm-migration

Installation
SKILL.md

Generating TypeORM Migrations

This skill covers the end-to-end process for creating a TypeORM database migration. It ensures migrations are generated correctly, named clearly, and never run automatically. Follow these steps in order every time.

Step 1 — Update the Entity

Modify the relevant TypeORM entity file (located in apps/api/src/core/<domain>/entities/ or libs/). Add or change columns, indexes, relations, etc. using TypeORM decorators.

Use generated migrations by default. Do not write migration SQL by hand unless TypeORM cannot represent the database object you need.

Step 2 — Generate the Migration

Run the following command from the project root, passing a --name flag with a clear descriptive slug:

npm run migration:api:generate --name=<migration-name>

The name becomes part of the filename: apps/api/src/database/migrations/<timestamp>-<migration-name>.ts. Choose it carefully upfront — use kebab-case and follow the conventions from existing migrations:

Installs
20
First Seen
May 29, 2026
generating-typeorm-migration — ilya-valasiuk/agent-skills