스킬 database-migrations-sql-migrations
📦

database-migrations-sql-migrations

안전

SQL 데이터베이스 마이그레이션 마스터

이 스킬은 내장된 롤백 절차와 유효성 검사를 통해 PostgreSQL, MySQL 및 SQL Server의 무중단 데이터베이스 마이그레이션을 구현할 수 있도록 도와줍니다.

지원: Claude Codex Code(CC)
🥉 72 브론즈
1

스킬 ZIP 다운로드

2

Claude에서 업로드

설정 → 기능 → 스킬 → 스킬 업로드로 이동

3

토글을 켜고 사용 시작

테스트해 보기

"database-migrations-sql-migrations" 사용 중입니다. Create a zero-downtime migration to add a status column to orders table

예상 결과:

  • 마이그레이션 분석 보고서
  • 1. 전략: 확장-수축 패턴
  • 2. 1단계 (확장): nullable status 컬럼 추가
  • 3. 2단계 (마이그레이션): 배치로 state 컬럼에서 status 백필
  • 4. 3단계 (수축): 코드 배포 후 이전 state 컬럼 제거
  • 5. 검증: 행 개수 일치, 데이터 손실 없음
  • 6. 롤백: 검증 실패 시 스냅샷으로 복원

"database-migrations-sql-migrations" 사용 중입니다. Write a rollback script for version 001 migration

예상 결과:

  • v001용 롤백 스크립트
  • - 현재 버전 일치 확인
  • - 롤백 전 백업 생성
  • - down.sql 마이그레이션 실행
  • - 마이그레이션 레코드 제거
  • - 롤백 성공 검증

보안 감사

안전
v1 • 2/24/2026

All 63 static findings are false positives. The skill provides legitimate SQL migration examples including PostgreSQL functions (gen_random_uuid, pg_sleep), database introspection queries (pg_indexes), and configuration references. No actual command injection, weak cryptography, or data exfiltration present. This is a benign database migration guidance skill.

2
스캔된 파일
549
분석된 줄 수
4
발견 사항
1
총 감사 수
중간 위험 문제 (2)
External Commands Pattern (False Positive)
Scanner flagged SQL/PL/pgSQL syntax as shell commands. Code contains PostgreSQL functions like gen_random_uuid() and pg_sleep() which are legitimate database operations, not shell execution.
Database File References (False Positive)
Scanner flagged database file path references as sensitive data. These are legitimate configuration references for migration scripts.
낮은 위험 문제 (2)
Database Introspection Queries (False Positive)
Scanner flagged pg_indexes queries as system reconnaissance. These are standard database introspection for migration planning.
Cryptographic Function Flagged (False Positive)
Scanner flagged gen_random_uuid() as weak cryptographic algorithm. This is PostgreSQL's cryptographically secure UUID v4 generator.
감사자: claude

품질 점수

38
아키텍처
100
유지보수성
87
콘텐츠
50
커뮤니티
91
보안
91
사양 준수

만들 수 있는 것

중단 없이 새 컬럼 추가

배치 데이터 백필과 함께 확장-수축 패턴을 사용하여 대용량 프로덕션 테이블에 NOT NULL 컬럼을 안전하게 추가합니다.

레거시 스키마 새 구조로 마이그레이션

이중 쓰기 동기화가 있는 블루-그린 마이그레이션을 사용하여 데이터 손실 없이 레거시에서 새 스키마로 마이그레이션합니다.

안전한 롤백 절차 생성

실패한 마이그레이션에서 복구하기 위한 마이그레이션 전 스냅샷과 검증 검사가 포함된 자동화된 롤백 스크립트를 생성합니다.

이 프롬프트를 사용해 보세요

기본 마이그레이션 요청
Create a migration script to add a new column called email_verified (BOOLEAN, DEFAULT FALSE) to the users table in PostgreSQL. Include proper error handling.
무중단 마이그레이션
Generate a zero-downtime migration strategy to convert a VARCHAR column to ENUM type in a production MySQL database with 10M+ rows.
유효성 검사가 포함된 데이터 마이그레이션
Write a migration to move data from the legacy orders table to a new v2_orders table. Include pre-validation checks, batched backfill, and post-migration row count verification.
롤백이 포함된 완전한 마이그레이션
Create a full migration package for adding a JSONB metadata column to the products table. Include: forward migration SQL, rollback SQL, validation checks, and a shell script for execution with proper error handling.

모범 사례

  • 프로덕션에서 마이그레이션 실행 전 항상 데이터베이스 스냅샷 또는 백업 생성
  • 마이그레이션 단계의 원자성을 보장하려면 트랜잭션 블록(BEGIN/COMMIT) 사용
  • 데이터 손실 감지를 위해 마이그레이션 전후 행 개수 검증
  • 프로덕션을 미러링하는 스테이징 환경에서 마이그레이션 테스트

피하기

  • 마이그레이션 전 검증 없이 프로덕션에서 직접 마이그레이션 실행
  • PostgreSQL에서 대용량 테이블에 CONCURRENTLY 플래그 없이 ALTER TABLE 사용
  • 프로duc­tion에서 스키마 변경에 대한 롤백 절차 건너뛰기
  • 마이그레이션 중 외래 키 제약 조건과 참조 무결성 고려하지 않음

자주 묻는 질문

이 스킬은 어떤 데이터베이스를 지원하나요?
이 스킬은 PostgreSQL, MySQL 및 SQL Server를 지원합니다. MongoDB 같은 NoSQL 데이터베이스는 nosql-migrations 스킬을 사용하세요.
이 스킬이 마이그레이션을 실행하나요?
아니요, 이 스킬은 마이그레이션 스크립트와 가이드를 생성합니다. 생성된 SQL은 데이터베이스 환경에서 직접 검토하고 실행해야 합니다.
마이그레이션 중 무중단을 어떻게 보장하나요?
확장-수축 패턴을 사용하세요: 먼저 새 컬럼/테이블을 추가하고(하위 호환), 배치로 데이터를 마이그레이션한 다음 코드 배포 후 이전 구조를 제거합니다.
Flyway나 Alembic과 함께 사용할 수 있나요?
네, 이 스킬에는 Flyway와 Alembic 마이그레이션 프레임워크 모두에 대한 예제가 포함되어 있습니다. 생성된 스크립트는 기존 마이그레이션 도구에 맞게 수정할 수 있습니다.
어떤 검증 검사를 실행해야 하나요?
마이그레이션 전 검사(NULL 값, 중복, 외래 키 무결성)와 마이그레이션 후 검사(행 개수, 제약 조건 검증, 인덱스 존재)를 실행하세요.
마이그레이션 실패를 처리하려면 어떻게 해야 하나요?
트랜잭션 내 세이브포인트를 사용하고, 마이그레이션 전 백업을 생성하며, 롤백 스크립트를 준비하세요. 이 스킬은詳細な 롤백 절차 예제를 제공합니다.

개발자 세부 정보

파일 구조