Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Schema Migration Generator

    1

    Automated SQL migration generator for diffing schemas and creating safe, dialect-specific up/down scripts.

    $2.99

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Schema Migration Generator

    Schema Migration Generator

    Example session with this skill installed

    Generate a PostgreSQL migration for Flyway that adds a 'refund_amount' decimal column and a 'refunded_at' timestamp to the 'orders' table. The new columns should allow nulls.

    • Read your context and instructions
    • Compiled the schema migration generator

    I have generated the PostgreSQL migration scripts for the requested changes to the orders table. The scripts follow Flyway naming conventions and include safety notes for the new columns.

    Migration Scripts

    File: V20231027101500__add_order_refunds.sql (Up)

    -- Up Migration
    -- Risk: Low. Adding nullable columns is a metadata-only operation in modern Postgres.
    ALTER TABLE orders 
      ADD COLUMN refund_amount DECIMAL(12, 2) DEFAULT NULL,
      ADD COLUMN refunded_at TIMESTAMP WITH TIME ZONE DEFAULT NULL;
    
    -- Create index for performance on refund queries
    CREATE INDEX CONCURRENTLY idx_orders_refunded_at ON orders(refunded_at) WHERE refunded_at IS NOT NULL;
    

    File: U20231027101500__add_order_refunds.sql (Down)

    -- Down Migration
    DROP INDEX CONCURRENTLY IF EXISTS idx_orders_refunded_at;
    ALTER TABLE orders 
      DROP COLUMN IF EXISTS refund_amount,
      DROP COLUMN IF EXISTS refunded_at;
    

    Safety Guidance

    • Operation: Adding nullable columns.
    • Risk: Low. No table rewrite required for PG 11+.

    Optimization: I added CONCURRENTLY to the index creation to prevent locking the orders table during the build. Note that concurrent index builds cannot run inside a transaction block in some runners.

    Next steps

    1. Verify the DECIMAL precision meets your specific currency requirements.
    2. Run the migration against a staging environment with a representative data set.
    3. Ensure your application code is deployed to handle the new nullable fields before applying the migration.
    V20231027101500__add_order_refunds.sql

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Database schema changes often result in manual, error-prone SQL scripts or unreliable ORM auto-generation. This skill automates the diffing process between schema states to produce production-ready migration files with safety guards.

    What it does

    • Schema Diffing compares DDL or ORM exports to detect structural changes.
    • Migration Generation outputs ordered up and down scripts for major SQL dialects.
    • Change Detection handles tables, columns, indexes, constraints, and probable renames.
    • Safety Auditing flags risky operations like table rewrites or locking index builds.
    • Multi-Format Export supports Flyway, Liquibase, golang-migrate, and Rails/Knex naming.

    How it works

    1. Provide a current schema dump and a desired-state schema file.
    2. Specify the target dialect (PostgreSQL, MySQL, SQLite, or SQL Server).
    3. Select the output style for file naming conventions.
    4. Review the generated SQL and the safety guidance for zero-downtime deployment.

    Frameworks & tools

    This skill works with PostgreSQL, MySQL, MariaDB, SQLite, and SQL Server. It integrates with migration runners like Flyway, Liquibase, golang-migrate, Rails, and Knex.

    Why this beats prompting it yourself

    Generic LLMs often hallucinate syntax or miss subtle dialect-specific constraints like index locking behavior. This skill follows a structured diffing logic to ensure every ADD, ALTER, and DROP is accounted for while explicitly warning about operations that could cause production downtime.

    Use cases

    • Generating Flyway scripts from a local PG dump and a new schema.sql.
    • Auditing a proposed migration for potential table-locking risks.
    • Creating idempotent down-migration scripts for emergency rollbacks.
    • Converting an ORM-generated schema into standard SQL migration files.

    Known limitations

    Does not support NoSQL databases. Requires raw SQL DDL as input for the most accurate diffing. Renames are detected by probability and may require manual confirmation.

    Supports SQL databases only. Requires DDL or schema dumps for input. Complex renames may require manual review to confirm intent.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 1 month ago

    Permissions

    Terminal / Shell
    Listed1 month ago

    What's inside

    Frequently Asked Questions

    This skill compares your current SQL DDL with your desired schema state to automatically generate precise up and down migration scripts, preventing the manual errors and syntax hallucinations common with generic AI models.

    It supports PostgreSQL, MySQL, MariaDB, SQLite, and SQL Server, and can export files formatted for popular runners like Flyway, Liquibase, and golang-migrate.

    The skill includes a safety auditing feature that flags risky operations, such as table rewrites or blocking index builds, and provides guidance for achieving zero-downtime deployments.

    While the skill uses high-probability detection for renames, these specific changes may require manual confirmation to ensure the logic perfectly matches your intent.

    You receive the full skill logic compatible with your AI agent platform, including pre-configured templates for all supported dialects and output formats.

    Currently, the skill is optimized for relational SQL databases; it does not support NoSQL databases like MongoDB or DynamoDB.

    New in Data & Databases