Skip to content
Back to skills

Database Migration Generator

ASecurity

Generate database migration scripts with rollback support for various databases. Use when creating schema migrations or database changes.

  • 754 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added February 8, 2026
databasestypescriptsqldatabase

Security analysis

A100/100

Scanned February 10, 2026

npx -y skills add majiayu000/claude-skill-registry --skill database-migration-generator --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Database Migration Generator?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Database Migration Generator
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-database-migration-generator/badge)](https://www.skillsdirectory.com/skills/majiayu000-database-migration-generator)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: database-migration-generator
description: Generate database migration scripts with rollback support for various databases. Use when creating schema migrations or database changes.
---

# Database Migration Generator Skill

データベースマイグレーションスクリプトを生成するスキルです。

## 主な機能

- **テーブル作成**: CREATE TABLE
- **カラム追加/削除**: ALTER TABLE
- **インデックス**: CREATE INDEX
- **外部キー**: FOREIGN KEY制約
- **ロールバック**: DOWN migration

## 生成例

```sql
-- migrations/001_create_users.up.sql
CREATE TABLE users (
    id SERIAL PRIMARY KEY,
    email VARCHAR(255) NOT NULL UNIQUE,
    name VARCHAR(100) NOT NULL,
    password_hash VARCHAR(255) NOT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE INDEX idx_users_email ON users(email);

-- migrations/001_create_users.down.sql
DROP TABLE IF EXISTS users;
```

## TypeORM (TypeScript)

```typescript
import { MigrationInterface, QueryRunner, Table } from 'typeorm';

export class CreateUsers1234567890 implements MigrationInterface {
    async up(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.createTable(new Table({
            name: 'users',
            columns: [
                {
                    name: 'id',
                    type: 'int',
                    isPrimary: true,
                    isGenerated: true,
                    generationStrategy: 'increment'
                },
                {
                    name: 'email',
                    type: 'varchar',
                    isUnique: true
                }
            ]
        }));
    }

    async down(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.dropTable('users');
    }
}
```

## バージョン情報
- Version: 1.0.0

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in databases →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.