본문으로 건너뛰기
cccskills
무료GitHub에 공개한국어 소개

db-migrations

새 Neon 브랜치에서 Drizzle 데이터베이스 마이그레이션을 생성하고 운영 적용 전 안전성을 확인합니다. 테이블 크기, 잠금 순서, 실행 시간, 데이터 이동 필요성을 살피며 규모가 크거나 사용량이 많은 테이블은 부하 테스트도 진행합니다.

원문원문 설명 보기

Create a database migration with Drizzle on a fresh Neon branch, and check it is safe to run against production under load. Use when changing the packages/db schema, generating migrations, or reviewing one.

ParadevAI/Paradev스타 15,720(GitHub 15,720 + cccskills 0)

실행 점수 미검증

설치 방법 보기

이럴 때 유용합니다

  • 스키마 변경으로 마이그레이션 파일 생성
  • 운영 적용 전 잠금 위험 확인
  • 대형 테이블 변경 부하 테스트
  • 읽기 대상 변경 시 데이터 이동 점검

한국어 소개

할 수 있는 일

Drizzle로 데이터베이스 구조 변경 파일을 생성하고 운영 환경에 적용하기 전 안전성을 확인합니다. 새 Neon 브랜치에서 변경 사항을 시험하고 대상 테이블의 크기, 잠금 획득 순서, 각 SQL의 실행 시간을 점검합니다. 규모가 크거나 자주 사용되는 테이블을 변경하는 경우 pgbench로 부하를 걸어 리허설할 수도 있습니다.

이럴 때 유용합니다

packages/db의 스키마를 변경하거나 생성된 마이그레이션을 검토할 때 사용할 수 있습니다. 열 형식 변경으로 인한 대형 테이블 재작성, 잠금 경합, 읽기 대상을 새 테이블이나 열로 바꿀 때 데이터 이동을 빠뜨리는 문제를 확인하는 데 도움이 됩니다.

사용 예시

  • “이 스키마 변경으로 마이그레이션을 만들고 운영 테이블 크기와 잠금 순서를 확인해 주세요.”
  • “운영 환경에서 분기한 Neon 브랜치에 부하를 걸어 이 변경을 검증해 주세요.”

주의 사항

Neon, Drizzle, Bun을 사용하는 구성이 전제이며 부하 테스트에는 pgbench가 필요합니다. 마이그레이션은 개발 브랜치에만 적용해야 합니다. 공유 및 운영 데이터베이스는 지정된 배포 절차로 갱신합니다. 생성된 파일을 직접 편집하려면 명시적인 확인이 필요합니다. 운영 설정에서 각 SQL 문에는 60초 제한이 적용됩니다.

이 소개문은 공개된 SKILL.md를 바탕으로 AI(OpenAI Codex)가 작성했습니다. 정확한 사양은 아래 원문을 확인하세요.

문서 점검

AI가 SKILL.md의 내용에서 주의가 필요한 작업과 도입 전제를 확인했습니다. 점수는 실제로 실행한 결과(실행 검증)만으로 매깁니다.

안전성전송·삭제·명령 실행 등을 명시하고 있는가
B일부 부족운영 조회와 마이그레이션 명령이 있으며 브랜치 제한과 시간 제한을 안내합니다.
도입의 용이성필요한 도구나 API 키가 적고 적혀 있는가
B일부 부족Neon, Drizzle, Bun이 필요하며 부하 리허설에는 `pgbench`도 필요합니다.

점수에는 넣지 않았습니다. 2026년 10월 29일 기준으로 AI(OpenAI Codex)가 판정했습니다. 참고용이므로 설치 전에 원문도 확인해 주세요.

평가가 다르다고 생각되면 재검토를 요청하기

어느 항목이 왜 다르다고 생각하는지 적어 주세요. 로그인은 필요 없습니다. SKILL.md와 대조해 평가를 다시 만들고 이곳에 반영합니다.

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

포함된 파일(1)

  • SKILL.md8.0 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

DB migrations

A migration that is correct on a quiet database can still take production down. On 17 September 2026 migration 0119 rewrote ingest.webhook_events (about 540 GB with indexes) while holding ACCESS EXCLUSIVE on the auth tables, and took the API down. Generate the migration with the steps below, then clear the safety checklist before opening the PR.

Generate

  1. Spin up a new Neon branch and point the root .env files at it. NEON_ORG_ID and NEON_PROJECT_ID are in .env; the Neon list_projects tool needs org_id passed in.
  2. Change the schema in packages/db/src/schema/.
  3. Run bunx drizzle-kit generate --name="<sample_name_snake_case>" from packages/db.
  4. Apply it to your dev branch only. Never apply against a shared or production database; those go through the deploy flow described under "What the production deploy does".

Never hand-edit packages/db/drizzle/ (.sql files, meta/_journal.json, snapshots) without explicit user confirmation. Change the schema and let drizzle-kit generate write the files. The one legitimate reason to ask for that confirmation is statement order (rule 3).

Safety checklist

  • Production sizes checked for every table the migration touches (query below)
  • No column type change on a large or busy table (rule 2)
  • Locks are taken child table first, then the tables it references (rule 3)
  • No long ACCESS EXCLUSIVE on a hot table (rule 4)
  • Every statement finishes well inside 60 seconds at production size
  • Rehearsed on a Neon branch of production under load, when the migration locks a hot table (rule 4) or rewrites or scans a large one. Otherwise the size and lock checks are enough
  • If reads move to a new table or column, the data moves in the same release (rule 5)
  • No tRPC input or output change in the same PR, so a bad API change can still be reverted (#7726; see .agents/skills/trpc-compat/SKILL.md)
  • After changing an already-pushed migration, the PR's preview Neon branch was deleted

Check production sizes first

Run this read-only against production, with the tables your migration touches:

begin transaction read only;
select c.oid::regclass as table_name,
       pg_size_pretty(pg_total_relation_size(c.oid)) as total_size,
       c.reltuples::bigint as approx_rows
from pg_class c
where c.oid in ('ingest.webhook_events'::regclass, 'automation_events'::regclass);
rollback;

Sizes on 2026-09-19, indexes included:

TableSizeRows
ingest.webhook_eventsabout 540 GB~199M
automation_eventsabout 245 GB~54M

Rules

1. All pending migrations run in ONE transaction

PgDialect.migrate in drizzle-orm 0.45.2 (pg-core/dialect.js) wraps the loop over every pending migration in a single session.transaction.

  • Splitting a change across several migration files gives no lock isolation.
  • Every lock an early statement takes is held until the last statement of the last file finishes.

2. Never change a column's type on a large, busy table in a normal migration

ALTER COLUMN ... SET DATA TYPE between types that are not binary-coercible rewrites the whole table and its indexes under ACCESS EXCLUSIVE. Enum to text on ingest.webhook_events was the outage.

Safe shapes:

  • For an enum, ALTER TYPE ... ADD VALUE.
  • Otherwise add a new column, backfill it in batches, and swap in a later release.

3. Take locks in the order the application does: child first, then its parents

An insert locks its own table, then takes RowShare on each foreign-key parent. DROP TABLE ... CASCADE, DROP CONSTRAINT and ADD CONSTRAINT ... FOREIGN KEY lock the referenced tables too. A migration that locks a parent before the child deadlocks against in-flight inserts.

  • The generated order of 0119 locked auth.organizations before automation_events and deadlocked 3 attempts out of 3 under load.
  • Hand-ordering the automation_events statement first fixed it (4 of 4).

drizzle-kit picks statement order, so this is the one legitimate reason to hand-order a generated file. Get explicit user confirmation first, and say why in a SQL comment above the moved statement, because regenerating restores the bad order. See packages/db/drizzle/0119_plugin_oauth_clients_and_connectors.sql for the pattern.

4. Know what is hot

TableWhy it is hot
auth.users, auth.organizationsRead by every authenticated request. ACCESS EXCLUSIVE for more than a moment is an outage.
automation_events, ingest.webhook_eventsHeld in a transaction almost continuously by the dispatch sweep (redispatchUndispatched) and the retention job (enforce-retention). A 5 second lock wait succeeded from about 44% of start times. A migration that needs their table lock should first wait on the job's own advisory lock (the singleFlight key), which lets the running batch finish without queueing inserts; 0122_webhook_events_swap_to_short_retention.sql is the pattern.

Because of rule 1, a statement queued behind a lock on automation_events keeps every lock the transaction already holds, including any on the auth tables.

5. Moving where data is READ from means moving the data in the same release

#7317 pointed every integration lookup at a new, empty connections table with no backfill. 2,393 live integrations read as disconnected until packages/trpc/scripts/backfill-connections.ts ran.

CI cannot catch this: unit tests mock the lookup layer (mock.module("@superset/trpc/connectors", ...)). Ship the backfill with the schema change.

Rehearse on a Neon branch of production, under load

A workspace's own Neon branch is a copy-on-write child of production at the same 0.25 to 2 CU size. A quiet rehearsal is not enough: the first one for 0119 passed in 2.3s and missed the deadlock entirely. pgbench found it immediately.

Rehearse when the migration locks a table in rule 4 or rewrites or scans a large table. A migration that only touches small tables that no job holds open does not need it: check the sizes, the lock order and the statement types, and say in the PR that you did not rehearse and why.

  1. Point at a production-child branch that does not have your migration yet. The workspace .env has two DATABASE_URL entries and the last one is the workspace branch.
  2. Write two pgbench scripts: reads on the parent tables your migration locks, and inserts into the child table.
  3. Start pgbench with both scripts (pgbench -n -f reads.sql -f inserts.sql -c <clients> -T <seconds>).
  4. While it runs, apply the migration with the production settings: PGOPTIONS="-c lock_timeout=5s -c statement_timeout=60s" bun drizzle-kit migrate.
  5. Repeat a few times. One pass proves little; 0119 was judged on 3 of 3 failures and 4 of 4 passes.

What the production deploy does

Job deploy-database in .github/workflows/deploy-production.yml:

  • A concurrency group, so two migration runs never overlap.
  • PGOPTIONS: -c lock_timeout=5s -c statement_timeout=60s.
  • Up to 8 attempts, retried only when the log contains "deadlock detected" or "lock timeout". Any other failure stops the deploy.
  • Then packages/db/src/verify-migrations-applied.ts, which fails unless the newest migration recorded in the database equals the newest journal entry.

A migration that needs longer than 60 seconds for one statement fails by design. Do that work online instead (rule 2).

A reused preview branch proves nothing

deploy-preview.yml names the Neon branch after the PR head ref and reuses it across pushes. Once the branch has applied a migration, later pushes that change that migration make the PR's database check a no-op. Delete the Neon branch to force a real run.

Workflow pitfalls from the same incident (pipefail, production secrets) are in docs/deploy-workflows.md.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

10x

무료요약 있음

Superset 사용 현황을 살펴보고 아직 쓰지 않는 기능 중 업무 방식에 맞는 항목을 제안합니다. 각 기능을 설명하고, 사용자가 고른 예약 실행 에이전트나 병렬 작업 공간, 공유 작업 등을 설정합니다.

  • 사용하지 않는 Superset 기능 찾기
  • 에이전트 예약 실행 설정
  • 여러 작업 공간에서 병렬 작업
ParadevAI/Paradev1.6만2026년 10월 29일 업데이트

automate

무료요약 있음

반복 작업을 Superset 자동화로 설정합니다. 에이전트 지침, 일정 또는 이벤트 조건, 실행 작업 공간을 정리하고 명시적인 확인을 받은 뒤 자동화를 만듭니다. 저장된 조건과 첫 실행 결과를 살펴 지침을 조정합니다.

  • 매일 또는 매주 작업 예약
  • GitHub에서 풀 리퀘스트가 열릴 때 실행
  • Slack의 지정된 반응을 계기로 실행
ParadevAI/Paradev1.6만2026년 10월 29일 업데이트

browser

무료요약 있음

Superset 작업 공간의 브라우저에서 페이지를 열고 클릭하거나 입력하며, 화면과 콘솔 정보를 확인합니다. 개발 중인 웹 앱 미리 보기, 폼 동작 및 화면 이동 점검에 활용할 수 있습니다.

  • 로컬 웹 앱 미리 보기
  • 페이지 화면 캡처
  • 콘솔 오류 확인
ParadevAI/Paradev1.6만2026년 10월 29일 업데이트

build-a-stripe-integration

무료요약 있음

Stripe 공식 문서와 API 매개변수 정의를 확인해 결제, 구독, 청구서, 웹훅 연동을 구현합니다. 적절한 제품 선택부터 샌드박스 테스트와 웹훅 처리까지 다루며, 결제와 구독 상태를 웹훅 이벤트로 판단합니다.

  • 정기 결제에 맞는 Stripe 제품 선택
  • Checkout 또는 청구서 처리 구현
  • 오작동하는 Stripe 연동 조사
ParadevAI/Paradev1.6만2026년 10월 29일 업데이트

cdp-verification

무료요약 있음

Chrome DevTools Protocol로 실행 중인 Electron 데스크톱 앱을 조작해 UI 변경을 확인하고 문제를 재현합니다. 실제 사용 흐름을 따라 화면 전환을 검증하고, 스크린샷과 경로·스크롤 위치·포커스·저장 상태를 기록해 비교합니다.

  • 실행 중인 앱에서 UI 문제 재현
  • 수정 후 화면 동작 확인
  • 화면 전환이 포함된 흐름 검증
ParadevAI/Paradev1.6만2026년 10월 29일 업데이트

ci-triage

무료요약 있음

GitHub Actions 실패 로그에서 최초 오류를 찾아 코드 결함, 환경 문제, 간헐적 실패, 기존 장애로 구분합니다. 기준 브랜치와 PR 변경 사항을 비교해 관련성을 설명하고 다음 조치를 정리합니다.

  • PR 검사 실패 원인 조사
  • 불안정한 테스트와 코드 결함 구분
  • 기준 브랜치의 기존 장애 확인
ParadevAI/Paradev1.6만2026년 10월 29일 업데이트

ParadevAI의 스킬 모두 보기

이 스킬의 문제 신고