Communitygithub.com

ComeOnOliver/skillshub

프로젝트 규칙에 따라 Prisma, Sequelize, Alembic, Knex, TypeORM 및 기타 ORM에 맞는 데이터베이스 마이그레이션 파일을 생성합니다. 테이블 추가, 스키마 수정 또는 데이터베이스 변경이 필요할 때 사용하세요.

skillshub란 무엇인가요?

이 스킬은 다양한 ORM 및 마이그레이션 도구를 지원하는 데이터베이스 마이그레이션 도우미입니다. 프로젝트에서 사용 중인 ORM(Prisma, Sequelize, Knex, TypeORM, Alembic, Django, Rails 등)을 자동으로 감지하고, 기존 마이그레이션 파일의 명명 규칙과 디렉토리 구조를 분석하여 일관된 스타일의 마이그레이션 파일을 생성합니다. 개발자는 수동으로 마이그레이션을 작성하지 않아도 되며, 생성, 변경, 롤백 등 모든 방향을 지원합니다. 이 스킬은 데이터 손실 방지, 테이블 잠금 최소화, 대규모 데이터 처리 등 안전성 검증도 포함하며, 템플릿 디렉토리를 통해 각 ORM별 예제를 제공합니다. Claude Code, Cursor, Codex 등의 AI 에이전트와 함께 사용하면 데이터베이스 스키마 변경 작업을 더 빠르고 오류 없이 수행할 수 있습니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/aiskillstore/marketplace/crazydubya/database-migration-helper

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

데이터베이스 마이그레이션 도우미

이 스킬은 프로젝트의 ORM 규칙과 명명 패턴에 맞는 데이터베이스 마이그레이션 파일을 만드는 데 도움을 줍니다.

이 스킬을 사용해야 할 때

  • 사용자가 데이터베이스 마이그레이션 생성을 요청할 때
  • 새 테이블이나 컬럼을 데이터베이스에 추가할 때
  • 기존 데이터베이스 스키마를 수정할 때
  • 인덱스, 제약 조건 또는 관계를 생성할 때
  • 사용자가 "마이그레이션", "스키마 변경", "데이터베이스 업데이트"를 언급할 때

지침

1. ORM/마이그레이션 도구 감지

먼저 프로젝트에서 사용하는 ORM 또는 마이그레이션 도구를 식별합니다:

  • Prisma: prisma/schema.prisma 또는 package.json의 @prisma/client 확인
  • Sequelize: .sequelizerc 또는 package.json의 sequelize-cli 확인
  • Knex: knexfile.js 또는 package.json의 knex 확인
  • TypeORM: ormconfig.json 또는 package.json의 typeorm 확인
  • Alembic (Python): alembic.ini 또는 alembic/ 디렉토리 확인
  • Django: manage.py 및 */migrations/ 경로의 Django 마이그레이션 확인
  • Active Record (Rails): db/migrate/ 디렉토리 확인
  • Flyway: flyway.conf 또는 db/migration/ 확인
  • Liquibase: liquibase.properties 또는 체인지로그 파일 확인

Glob을 사용하여 이러한 표시 파일을 검색합니다.

2. 기존 마이그레이션 확인

기존 마이그레이션 파일을 읽어 다음 사항을 이해합니다:

  • 명명 규칙 (타임스탬프 형식, 설명 형식)
  • 디렉토리 구조
  • 마이그레이션 파일 형식 (SQL, JavaScript, TypeScript, Python 등)
  • 코딩 패턴 (up/down 함수, forwards/rollback 등)

Grep을 사용하여 최근 마이그레이션을 찾습니다. 일반적인 디렉토리:

  • prisma/migrations/
  • db/migrate/
  • migrations/ 또는 database/migrations/
  • alembic/versions/

3. 마이그레이션 파일 생성

감지된 ORM에 따라 적절한 마이그레이션 파일을 생성합니다:

Prisma

  • npx prisma migrate dev --name <설명> 실행 또는
  • prisma/migrations/<타임스탬프>_<이름>/migration.sql에 수동으로 마이그레이션 SQL 생성

Sequelize

  • 생성: npx sequelize-cli migration:generate --name <설명>
  • 그런 다음 up/down 함수에 스키마 변경 내용을 작성

Knex

  • 생성: npx knex migrate:make <설명>
  • exports.up 및 exports.down 함수를 작성

TypeORM

  • 생성: npm run typeorm migration:create src/migrations/<이름>
  • up() 및 down() 메서드 구현

Alembic

  • 생성: alembic revision -m "<설명>"
  • upgrade() 및 downgrade() 함수를 작성

Django

  • 실행: python manage.py makemigrations
  • 또는 <앱>/migrations/에 수동으로 마이그레이션 생성

Rails

  • 생성: rails generate migration <클래스이름>
  • change 메서드 (또는 복잡한 마이그레이션의 경우 up/down)를 작성

4. 명명 규칙 준수

일관되고 설명적인 이름을 사용합니다:

  • 좋은 예: add_user_email_index, create_products_table, add_payment_status_to_orders
  • 나쁜 예: migration1, update, fix

프로젝트 패턴에 따라 형식 지정:

  • 타임스탬프 접두사: 20231215120000_add_email_to_users
  • 순차적: 001_create_users, 002_add_indexes

5. Up 및 Down/Rollback 모두 포함

지원되는 경우 항상 두 방향을 모두 제공합니다:

  • Up/Upgrade/Forward: 스키마 변경 적용
  • Down/Downgrade/Rollback: 스키마 변경 되돌리기

가역적 작업을 사용하는 ORM(Rails, 일부 Sequelize)의 경우 단일 change 메서드로 충분할 수 있습니다.

6. 마이그레이션 내용 가이드라인

테이블 생성:

  • 적절한 유형으로 모든 컬럼 정의
  • 적절한 위치에 NOT NULL 제약 조건 설정
  • 기본 키 추가
  • 프로젝트에서 사용하는 경우 타임스탬프(created_at, updated_at) 포함
  • 동일한 마이그레이션에 외래 키 및 인덱스 추가하거나 프로젝트 선호도에 따라 별도로 추가

테이블 변경:

  • 구체적으로 작성: ADD COLUMN, DROP COLUMN, MODIFY COLUMN
  • 기존 데이터를 적절히 처리 (기본값, 백필)
  • 역호환성 고려

인덱스 추가:

  • 인덱스 이름을 명확하게 지정: idx_users_email, idx_orders_user_id_created_at
  • 적절한 인덱스 유형 사용 (B-tree, Hash, GIN 등)
  • 큰 테이블의 경우 부분 인덱스 고려

데이터 마이그레이션:

  • 가능하면 스키마 마이그레이션과 데이터 마이그레이션을 분리
  • 대규모 데이터셋에 주의 (일괄 작업)
  • 실제적인 데이터 볼륨으로 롤백 테스트

7. 마이그레이션 안전성 검증

최종 확정 전에 다음 사항을 확인:

  • 가역성: 마이그레이션을 롤백할 수 있습니까?
  • 데이터 손실: 데이터가 손실됩니까? 사용자에게 경고!
  • 다운타임: 테이블이 잠깁니까? 큰 테이블의 경우 온라인 마이그레이션 고려
  • 의존성: 먼저 실행해야 하는 의존 마이그레이션이 있습니까?

8. 테스트 권장 사항

사용자에게 제안:

  • 먼저 개발 데이터베이스에서 마이그레이션 실행
  • 롤백 기능 테스트
  • 프로덕션의 경우: 스테이징 환경에서 테스트
  • 생성된 SQL 검토 (자동 생성하는 ORM의 경우)

ORM별 템플릿

templates/ 디렉토리의 템플릿을 참조:

  • prisma-migration.sql - Prisma 마이그레이션 예제
  • sequelize-migration.js - Sequelize 마이그레이션 예제
  • knex-migration.js - Knex 마이그레이션 예제
  • typeorm-migration.ts - TypeORM 마이그레이션 예제
  • alembic-migration.py - Alembic 마이그레이션 예제
  • rails-migration.rb - Rails 마이그레이션 예제

모범 사례

  1. 마이그레이션당 하나의 목적: 관련 없는 변경 사항을 혼합하지 마십시오.
  2. 설명적인 이름: 이름은 마이그레이션의 작업을 설명해야 합니다.
  3. 타임스탬프: 순서 지정을 위해 ORM의 타임스탬프 형식을 사용합니다.
  4. 가능하면 멱등성: 여러 번 실행해도 안전해야 합니다.
  5. 롤백 테스트: down/rollback이 올바르게 작동하는지 확인합니다.
  6. 복잡한 로직 문서화: 명확하지 않은 작업에는 주석을 추가합니다.
  7. 대규모 작업 일괄 처리: 많은 행에 영향을 미치는 데이터 마이그레이션의 경우.
  8. 트랜잭션 사용: 지원되는 경우 작업을 트랜잭션으로 묶습니다.

지원 파일

  • templates/: 다양한 ORM을 위한 마이그레이션 템플릿
  • reference.md: 명명 규칙 및 마이그레이션 패턴

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

ComeOnOliver/skillshub

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

ComeOnOliver/skillshub

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

ComeOnOliver/skillshub

SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.

ComeOnOliver/skillshub

See, Understand, Act on video and audio. See- ingest from local files, URLs, RTSP/live feeds, or live record desktop; return realtime context and playable stream links. Understand- extract frames, build visual/semantic/temporal indexes, and search moments with timestamps and auto-clips. Act- transcode and normalize (codec, fps, resolution, aspect ratio), perform timeline edits (subtitles, text/image overlays, branding, audio overlays, dubbing, translation), generate media assets (image, audio, video), and create real time alerts for events from live streams or desktop capture.

ComeOnOliver/skillshub

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

ComeOnOliver/skillshub

Next.js 15 애플리케이션을 위한 프론트엔드 개발 가이드라인. React 19, TypeScript, Shadcn/ui, Tailwind CSS를 사용한 모던 패턴. Server Components, Client Components, App Router, 파일 구조, Shadcn/ui 컴포넌트, 성능 최적화, TypeScript 모범 사례 포함. 컴포넌트, 페이지, 기능 생성, 데이터 페칭, 스타일링, 라우팅, 프론트엔드 코드 작업 시 사용.

ComeOnOliver/skillshub

Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).

ComeOnOliver/skillshub

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

ComeOnOliver/skillshub

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

ComeOnOliver/skillshub

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

ComeOnOliver/skillshub

Next.js development tooling via MCP. Inspect routes, components, build info, and debug Next.js apps. Use when working on Next.js applications, debugging routing, or inspecting app structure. NOT for general React or non-Next.js projects.

ComeOnOliver/skillshub

Implement UI using Shadcn MCP (atoms/theme) and 21st.dev MCP (complex sections). Use when adding buttons, layouts, or generating landing pages.

ComeOnOliver/skillshub

A conceptual skill for building an API client in Next.js that handles JWT tokens

ComeOnOliver/skillshub

Best practices and patterns for Next.js App Router, Server Actions, and Routing in this project.

ComeOnOliver/skillshub

The Design System, Theme, and UX rules for the Physical AI Hub.

ComeOnOliver/skillshub

Comprehensive frontend development skill for building modern, performant web applications using ReactJS, NextJS, TypeScript, Tailwind CSS. Includes component scaffolding, performance optimization, bundle analysis, and UI best practices. Use when developing frontend features, optimizing performance, implementing UI/UX designs, managing state, or reviewing frontend code.

ComeOnOliver/skillshub

This document captures learnings from fixing keyboard navigation issues when floating components (Select, DropdownMenu, Popover) have CSS open/close animations.

ComeOnOliver/skillshub

Build Next.js 16 applications with correct patterns and distinctive design. Use when creating pages, layouts, dynamic routes, upgrading from Next.js 15, or implementing proxy.ts. Covers breaking changes (async params/searchParams, Turbopack, cacheComponents) and frontend aesthetics. NOT when building non-React or backend-only applications.

ComeOnOliver/skillshub

Comprehensive Framer Motion animation library for React. Covers motion components, variants, gestures, page transitions, and scroll animations. Use when adding animations to React/Next.js applications.

ComeOnOliver/skillshub

Build interfaces that resonate, not just render. This skill enforces bold, intentional

관련 스킬