本文へスキップ
Skillpedia
APIとサーバー(バックエンド)81k · #1658

migrate-create

できること

このスキルは、順方向のファイルと取り消し用のファイルを持つ、新しい番号付きのデータベースマイグレーションを作成します。データベースのスキーマを整理された方法で変更する開発者向けです。

使う場面

  • ✓データベースにテーブル、列、インデックスを追加する必要があるとき。
  • ✓各変更に対応する取り消し用ファイルを作りたいとき。
  • ✓次のマイグレーション番号を自動で選んでほしいとき。

スキルのリンク

https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-migrations/skills/migrate-create/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-migrations/skills/migrate-create/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“tasks テーブルに期限の列を追加するマイグレーションを、その取り消し用ファイルとともに作ってください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

スキルは既存の最も大きい番号を見つけ、1を加えて、名前の先頭(create、add、drop など)に基づいてテンプレートを選びます。順方向と取り消しの SQL ファイルを書き込み、そのマイグレーションを記録します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Migrate Create

Generate a new database migration with sequential numbering and up/down SQL file pair.

When to use

When you need to create a new database migration for schema changes such as creating tables, adding columns, creating indexes, or modifying constraints.

Steps

  1. Determine next number -- use Glob to scan the migrations directory for existing migration files and find the highest number, then increment by 1 (zero-pad to 3 digits)
  2. Select template -- based on the <name>, choose the appropriate SQL template:
    • Names starting with create_ -> CREATE TABLE template
    • Names starting with add_ -> ALTER TABLE ADD COLUMN template
    • Names starting with drop_ -> DROP with safety checks
    • Names containing index -> CREATE INDEX template
    • Other -> generic migration template with placeholder comments
  3. Generate up migration -- write NNN_<name>.up.sql with the appropriate SQL using IF NOT EXISTS for idempotency
  4. Generate down migration -- write NNN_<name>.down.sql with the reverse operation using IF EXISTS
  5. Search past patterns -- call mcp__plugin_ruflo-core_ruflo__agentdb_pattern-search (ReasoningBank-routed; don't pass a namespace argument — pattern-* tools ignore it).
  6. Store metadata -- call mcp__plugin_ruflo-core_ruflo__memory_store --namespace migrations to record the migration with number, name, status (pending), and file paths. The memory_* tool family routes by namespace; agentdb_hierarchical-* does NOT (it routes by tier working|episodic|semantic), so use memory_* here. See ruflo-agentdb ADR-0001 §"Namespace convention".
  7. Report -- display: migration number, file paths created, template used, any similar past migrations found

CLI alternative

npx @claude-flow/cli@latest memory store --namespace migrations --key "migration-NNN_NAME" --value '{"number": NNN, "name": "NAME", "status": "pending"}'
よくある質問

テンプレートはどのように選ばれますか?

名前の先頭が決め手です。create、add、drop で始まる名前にはそれぞれのテンプレートが、index を含む名前にはインデックスのテンプレートが使われます。

マイグレーションを実行しますか?

説明では、ファイルの作成とメタデータの記録が扱われています。マイグレーションが適用されるとは書かれていません。

SQL を確認しますか?

いいえ。別の migrate validate スキルが、保留中のマイグレーションの安全性を確認します。

詳細

作者による元の説明

Create a new sequentially numbered database migration with up/down SQL files

repo: ruvnet/ruflo

人気

GitHubのスター
81k
ランキング
#1658
ライセンス
MIT
更新日
2026/11/2

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル