- Home
- Skills
- Data & Databases
- Freebies — Schema Migration Scaffold
Works with the AI Agents you already use
Freebies — Schema Migration Scaffold
Generate zero-downtime UP and DOWN database migration scripts for Flyway, Liquibase, Prisma, and Knex.
Free
Freebies — Schema Migration Scaffold
Example session with this skill installed
Generate a zero-downtime PostgreSQL migration to add an index on the email column of the users table and a down script to revert it for Knex.
- Read your context and instructions
- Compiled the freebies
I have generated the migration scripts using zero-downtime practices for PostgreSQL. The UP block uses CONCURRENTLY to avoid table locks, and the DOWN block provides a clean rollback.
Knex Migration: add_index_to_users_email
// Migration: add_index_to_users_email.js
exports.up = async function(knex) {
// PostgreSQL requires CONCURRENTLY to be run outside of a transaction block
// This script assumes the migration runner handles transaction isolation settings
await knex.raw('CREATE INDEX CONCURRENTLY IF NOT EXISTS users_email_index ON users (email)');
};
exports.down = async function(knex) {
// Reverting the index creation
await knex.raw('DROP INDEX CONCURRENTLY IF EXISTS users_email_index');
};
Next steps
- Ensure your migration runner (Knex) is configured to disable transactions for this specific file, as
CREATE INDEX CONCURRENTLYcannot run inside a transaction. - Verify the index creation by running
EXPLAINon a query targeting theemailcolumn in your development environment. - Review
references/technical-guide.mdfor specific PostgreSQL 12+ optimization flags.
Connects securely to your tools. The creator never sees your data.
About this skill
Stop crashing production with table-locking migrations. This skill generates zero-downtime database migration scripts designed for high-availability environments where schema changes cannot interrupt service.
What it does
- Reversible scripts generates paired
UPandDOWNblocks for every schema change to ensure safe rollbacks. - Lock avoidance implements non-blocking operations like
CREATE INDEX CONCURRENTLYin PostgreSQL to prevent performance degradation. - Evolution strategy scaffolds migrations that add columns as nullable first, maintaining compatibility with active application instances.
- Constraint management handles foreign keys and constraints without triggering full table rewrites or long-held locks.
How it works
- Define your target database engine and the specific schema change required.
- The agent analyzes the impact of the change on existing table locks and data integrity.
- It generates an
UPscript following zero-downtime best practices for your specific framework. - It provides a corresponding
DOWNscript to revert the changes exactly.
Frameworks & tools
Supports SQL-based migration tools including Flyway, Liquibase, Prisma, and Knex. Compatible with PostgreSQL, MySQL, and other standard relational engines.
Why this beats prompting it yourself
Generic prompts often ignore the operational reality of large datasets, leading to scripts that lock tables for minutes. This skill strictly enforces the "Zero-Downtime" architectural pattern, ensuring every generated script is safe for CI/CD deployment on production traffic.
Use cases
- Adding indexes to multi-million row tables without blocking writes.
- Renaming or adding columns during a rolling deployment.
- Modifying constraints while maintaining backwards compatibility.
- Generating boilerplate for Liquibase or Flyway XML/SQL migrations.
Known limitations
Does not perform live execution or database connectivity. All scripts are generated as static files restricted to the current workspace and require manual validation against specific engine versions.
Restricted to workspace file generation. Does not execute migrations or connect to live DBs. Requires manual validation for specific engine version quirks.
How to use
- 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
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 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
Free forever
No account required to browse
Trust & safety
Security scan
Security scan passed 2 days ago
- Free with an Agensi account
Requires
Permissions
Target Use Cases: - Create a zero-downtime database migration script. - Write UP and DOWN migration for adding an index concurrently. - Generate safe PostgreSQL migration script for large tables.