database-migration-generator_skill

This skill generates database migration scripts with up and down migrations, covering table creation, alterations, indexes, and foreign keys across databases.
  • HTML

1

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill ntaksh42/agents --skill database-migration-generator

  • SKILL.md1.8 KB

Overview

This skill generates database migration scripts with built-in rollback support for a range of relational databases and common ORMs. It produces up/down SQL files and can scaffold migration classes for TypeORM-style projects. The output focuses on schema changes: create/drop tables, add/remove columns, indexes, and foreign keys, with clear rollback steps.

How this skill works

Provide the desired schema change or current/target models and the skill outputs paired migration artifacts: an "up" migration to apply changes and a "down" migration to revert them. It can emit raw SQL compatible with common dialects and scaffold migration code for TypeORM (TypeScript). Each migration includes explicit operations for schema, indexes, constraints, and timestamps to ensure safe rollbacks.

When to use it

  • When adding, removing, or renaming tables and columns in a production schema
  • When creating repeatable, auditable migration files for deployment pipelines
  • When you need both SQL migrations and ORM-compatible migration classes (e.g., TypeORM)
  • When introducing indexes or foreign-key constraints with reversible changes
  • When preparing rollback plans for schema changes before applying to production

Best practices

  • Review generated down migrations to ensure destructive rollbacks handle data carefully
  • Run migrations in a staging environment matching production to verify behavior
  • Keep migrations small and focused: one logical change per migration file
  • Include explicit index and constraint creation/removal to avoid implicit behavior
  • Version and name migration files clearly (timestamp or incremental) for ordering

Example use cases

  • Generate an initial users table with email uniqueness, timestamps, and an index
  • Add a nullable profile_id column and corresponding foreign key with rollback
  • Create and later drop a performance index during optimization work
  • Scaffold TypeORM MigrationInterface classes for a TypeScript service
  • Produce paired up/down SQL files to include in CI/CD deployment artifacts

FAQ

The skill targets common relational dialects (PostgreSQL, MySQL, SQLite) and produces standard SQL and ORM scaffolding; dialect-specific adjustments may be needed for proprietary features.

Does the skill handle data migrations (transformations) as well as schema?

It primarily focuses on schema operations and reversible structural changes. Simple data transformations can be included, but complex ETL-like operations should be reviewed and tested carefully.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational