migration-helper

Generate, review, run, revert, and register TypeORM migrations across tenant, platform, and auth databases.

Updated Apr 6, 2026
One-click install
npx skills add https://github.com/lety-ai/lety-skill-hub --skill migration-helper-lety-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migration-helper
Source: https://github.com/lety-ai/lety-skill-hub/tree/main/plugins/migration-helper/skills/migration-helper
Command: npx skills add https://github.com/lety-ai/lety-skill-hub --skill migration-helper-lety-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps engineers create, verify, run, revert, and register TypeORM migrations across tenant, platform, and auth databases while enforcing project rules that prevent unsafe raw SQL and irreversible changes.

Core Features & Use Cases

  • Guided Generation: Use project-specific migration:generate scripts to produce descriptive, reversible migration files for entity additions and schema changes.
  • Automated Review Checklist: Verify up() and down() operations, types, defaults, indices, and foreign keys and flag common generation issues like missing down(), unexpected drops, or mixed unrelated changes.
  • Deployment Workflow: Register new migrations in the correct index file, run pending migrations on staging/production with precautionary checks, and revert the last migration when needed.
  • Use Case: When adding a new Invoice status column to the tenant database, generate the migration, review up/down for correctness, append the migration to the tenant index, run on staging, then run on production after verification.

Quick Start

Generate a tenant migration named AddInvoiceStatus with pnpm migration:generate:tenant AddInvoiceStatus, review the generated file for correct up and down implementations, append it to the tenant migrations index, and run it on staging for verification.

Frequently Asked Questions about migration-helper

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate and review TypeORM migrations for multiple schemas?

TypeORM migrations across tenant, platform, and auth schemas are generated using project-specific migration:generate scripts, then reviewed for up/down symmetry, correct types, defaults, indices, and foreign keys to ensure reversibility.

What is the best way to revert a TypeORM migration on a staging or production database?

Reverting a TypeORM migration on staging or production involves running the CLI revert command to undo the last applied migration, provided the down() method was correctly implemented during the initial migration review phase.

How do I register new TypeORM migrations in the correct index file?

Registering new TypeORM migrations requires appending the generated migration class to the correct schema-specific index file in chronological order, ensuring the migration runner discovers and applies dependencies sequentially.

Can I use raw SQL DDL in TypeORM migrations for data migrations?

Raw SQL DDL is prohibited in TypeORM migrations to prevent irreversible schema changes; instead, use the QueryRunner API within up and down methods to ensure operations remain reversible and type-safe.

Why does my TypeORM migration generation result in unexpected drops or missing down methods?

Unexpected drops or missing down methods in TypeORM migration generation occur when entity changes are mixed or unrelated, requiring an automated review checklist to validate generated up and down operations before deployment.

Does TypeORM migration:generate work for backend projects with tenant, platform, and auth databases?

TypeORM migration:generate works for multi-database backend projects by applying schema-specific generation scripts to tenant, platform, and auth databases, producing descriptive migration files for each distinct database connection.