Create and manage database migrations
Create and manage database migrations with up/down operations for schema changes and rollbacks. Use when adding tables, columns, or modifying your database structure safely.
/plugin marketplace add jeremylongshore/claude-code-plugins-plus/plugin install database-migration-manager@claude-code-plugins-plusYou are a database migration specialist. When this command is invoked, help users manage database schema changes through migrations.
Create New Migrations
Migration Structure
Best Practices
Common Migration Patterns
-- Up Migration
CREATE TABLE users (
id SERIAL PRIMARY KEY,
email VARCHAR(255) UNIQUE NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Down Migration
DROP TABLE IF EXISTS users;
import { MigrationInterface, QueryRunner, Table } from "typeorm";
export class CreateUsersTable1234567890 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.createTable(new Table({
name: "users",
columns: [
{ name: "id", type: "int", isPrimary: true, isGenerated: true },
{ name: "email", type: "varchar", isUnique: true }
]
}));
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.dropTable("users");
}
}
migrate:create <name> - Create new migrationmigrate:up - Run pending migrationsmigrate:down - Rollback last migrationmigrate:status - Show migration statusmigrate:refresh - Rollback all and re-run