본문으로 건너뛰기
cccskills
무료GitHub에 공개

database-migrations

Database schema changes — generate the migration, update the seed, reseed. Use when editing `app/db/schema.ts`, when adding or altering a table, column, or enum, or when `npm run db:seed` fails to start.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

mattpocock/cohort-005-project-fork-2스타 2(GitHub 2 + cccskills 0)

실행 점수 미검증

설치 방법 보기

포함된 파일(2)

  • SKILL.md2.4 KB
  • agents/openai.yaml119 B

SKILL.md(원문)

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

Database Migrations

The database is disposable. data.db is gitignored and holds nothing but seed data, so every schema change is free: migrate, throw the file away, reseed from scratch.

Disposable is also why scripts/seed.ts is part of every schema change rather than a follow-up. The seed script is the definition of the starting data, and it recreates the whole database on each run — so a schema change that skips it produces data whose shape no longer matches the schema.

Steps

  1. Edit the schema — app/db/schema.ts.

  2. Generate the migration — npm run db:generate. This writes a new numbered SQL file into drizzle/. Read it and confirm it says what you intended.

  3. Update scripts/seed.ts for every table you touched:

    • New table — add a DROP TABLE IF EXISTS line to the drop block at the top of seed(), positioned above the tables it has foreign keys into (children drop first), and insert rows for it.
    • New non-nullable column — give it a value in every .values({ ... }) call for that table.
    • Renamed or removed column — rename or remove it at every insert site for that table.
    • New enum — import it from ../app/db/schema and use its members at the insert sites, matching how UserRole and CourseStatus are used.
  4. Reseed — npm run db:seed. It drops every table, replays the migrations in drizzle/, and reinserts. It prints a summary of row counts when it finishes.

  5. Typecheck — npm run typecheck.

Done when every table changed in step 1 is accounted for in step 3, npm run db:seed prints its summary, and the typecheck passes.

When the seed fails to start

A half-applied migration can leave data.db in a state the seed cannot drop its way out of. Delete it and reseed:

rm -f data.db data.db-shm data.db-wal
npm run db:seed

Nothing is lost — the file is rebuilt from drizzle/ and scripts/seed.ts.

npm run db:migrate

npm run db:migrate applies pending migrations to the existing data.db, preserving the rows already in it. The seed already migrates before it inserts, so the steps above never need it. Reach for it when you specifically want to watch a migration land on existing data.

리뷰

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

댓글

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

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

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

0 / 1,000자

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

같은 저장소의 스킬

ask-matt

무료

Ask which skill or flow fits your situation. A router over the skills in this repo.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

mattpocock/cohort-005-project-fork-222026년 10월 21일 업데이트

Review the changes since a fixed point (commit, branch, tag, or merge-base) along two axes — Standards (does the code follow this repo's documented coding standards?) and Spec (does the code match what the originating issue/PRD asked for?). Runs both reviews in parallel sub-agents and reports them side by side. Use when the user wants to review a branch, a PR, work-in-progress changes, or asks to "review since X".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

mattpocock/cohort-005-project-fork-222026년 10월 21일 업데이트

Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

mattpocock/cohort-005-project-fork-222026년 10월 21일 업데이트

Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

mattpocock/cohort-005-project-fork-222026년 10월 21일 업데이트

Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

mattpocock/cohort-005-project-fork-222026년 10월 21일 업데이트

grill-me

무료

A relentless interview to sharpen a plan or design.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

mattpocock/cohort-005-project-fork-222026년 10월 21일 업데이트

mattpocock의 스킬 모두 보기

이 스킬의 문제 신고