본문으로 건너뛰기
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가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-migrations/skills/migrate-create/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 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

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬