skills$openclaw/migration-gen
lxgicstudios8.3k

by lxgicstudios

migration-gen – OpenClaw Skill

migration-gen is an OpenClaw Skills integration for coding workflows. Generate SQL migration files from ORM schemas. Use when managing database changes.

8.3k stars3.3k forksSecurity L1
Updated Feb 7, 2026Created Feb 7, 2026coding

Skill Snapshot

namemigration-gen
descriptionGenerate SQL migration files from ORM schemas. Use when managing database changes. OpenClaw Skills integration.
ownerlxgicstudios
repositorylxgicstudios/migration-gen
languageMarkdown
licenseMIT
topics
securityL1
installopenclaw add @lxgicstudios/migration-gen
last updatedFeb 7, 2026

Maintainer

lxgicstudios

lxgicstudios

Maintains migration-gen in the OpenClaw Skills directory.

View GitHub profile
File Explorer
9 files
.
src
cli.ts
1.3 KB
index.ts
2.8 KB
_meta.json
299 B
package-lock.json
46.0 KB
package.json
811 B
README.md
1.4 KB
SKILL.md
2.0 KB
tsconfig.json
251 B
SKILL.md

name: migration-gen description: Generate SQL migration files from ORM schemas. Use when managing database changes.

Migration Generator

Your ORM schema changed and you need migration files. This tool reads your schema and generates timestamped UP and DOWN migrations.

One command. Zero config. Just works.

Quick Start

npx ai-migrate --orm prisma --name add_users

What It Does

  • Reads Prisma, Drizzle, TypeORM, or Sequelize schemas
  • Generates timestamped migration folders
  • Creates both UP and DOWN SQL
  • Includes proper guards (IF NOT EXISTS, etc.)

Usage Examples

# Prisma migration
npx ai-migrate --orm prisma --name add_users

# Drizzle with custom output
npx ai-migrate --orm drizzle --name add_orders --output ./db/migrations

# TypeORM
npx ai-migrate --orm typeorm --name add_products

Best Practices

  • Test migrations locally - run up and down before deploying
  • Keep them small - one logical change per migration
  • Version control them - migrations are code
  • Never edit deployed migrations - create new ones instead

When to Use This

  • Schema changes need migration files
  • Converting ORM operations to raw SQL
  • Setting up migration workflow
  • Learning proper migration structure

Part of the LXGIC Dev Toolkit

This is one of 110+ free developer tools built by LXGIC Studios. No paywalls, no sign-ups, no API keys on free tiers. Just tools that work.

Find more:

Requirements

No install needed. Just run with npx. Node.js 18+ recommended. Needs OPENAI_API_KEY environment variable.

npx ai-migrate --help

How It Works

Finds your ORM schema files, parses the model definitions, and generates SQL migration files. Creates timestamped folders with up.sql and down.sql that are safe to run multiple times.

License

MIT. Free forever. Use it however you want.

README.md

ai-migrate

npm version npm downloads License: MIT

AI-powered database migration generator. Turn ORM schemas into SQL migration files.

Point it at your ORM schema, get SQL migration files. Supports Prisma, Drizzle, TypeORM, and Sequelize.

Install

npm install -g ai-migrate

Usage

npx ai-migrate --orm prisma --name add_users

It'll find your schema files automatically, read them, and generate timestamped UP and DOWN migration SQL files.

npx ai-migrate --orm drizzle --name add_orders --output ./db/migrations

Setup

export OPENAI_API_KEY=sk-...

Options

  • --orm <type> - Which ORM you're using (prisma, drizzle, typeorm, sequelize)
  • --name <name> - Name for this migration
  • -o, --output <dir> - Where to put the files (default: ./migrations)
  • -d, --dir <dir> - Project root to scan for schemas (default: current directory)

Output

Creates a timestamped folder with up.sql and down.sql:

migrations/
  20240115120000_add_users/
    up.sql
    down.sql

Both files include proper guards (IF NOT EXISTS, IF EXISTS) so they're safe to run.

License

MIT

Permissions & Security

Security level L1: Low-risk skills with minimal permissions. Review inputs and outputs before running in production.

Requirements

No install needed. Just run with npx. Node.js 18+ recommended. Needs OPENAI_API_KEY environment variable. ```bash npx ai-migrate --help ```

FAQ

How do I install migration-gen?

Run openclaw add @lxgicstudios/migration-gen in your terminal. This installs migration-gen into your OpenClaw Skills catalog.

Does this skill run locally or in the cloud?

OpenClaw Skills execute locally by default. Review the SKILL.md and permissions before running any skill.

Where can I verify the source code?

The source repository is available at https://github.com/openclaw/skills/tree/main/skills/lxgicstudios/migration-gen. Review commits and README documentation before installing.