prisma-next-migrations
БесплатноБез исполняемых скриптовНе проверенAuthor Prisma Next migrations — choose db update vs migration plan, edit the framework-rendered migration.ts (replace placeholder sentinels with dataTransform…
от prisma★ 407 звёзд на GitHubОб этом скилле
Prisma Next — Migration Authoring
Edit your data contract. Prisma Next plans the migration. You fill in any data transforms.
The three-step user model:
- You edit your data contract. (
prisma-next-contract) - Prisma Next plans the migration for you. ← this skill
- If a data transform is needed, you edit
migration.tsand self-emit. ← this skill
Once the contract changes, you choose how the change reaches the database. This skill covers the two paths (db update and migration plan + migrate), the migration-package contract, the migration.ts authoring API, and the failure modes you recover from without leaving the loop.
Targets. Migration authoring is first-class for Postgres and Mongo. The CLI reads the target from prisma-next.config.ts (set during prisma-next init --target …). Migration commands do not accept a --target flag — use a config scoped to the target you need. Examples below call out target-specific imports, markers, factories, and transaction behavior where they diverge.
When to Use
- User edited the contract and wants to apply the change to the DB.
- User wants to author a migration with a data transform.
- User wants to run pending migrations against a local DB.
- User hit
MIGRATION.HASH_MISMATCH,PN-MIG-2001(unfilled placeholder), or a partially-applied migration. - User mentions: migrate, migration, db push, db update,
prisma migrate dev,prisma migrate deploy, drift, hash mismatch, data backfill.
When Not to Use
- User wants to know what migrations will run on deploy / on merge, or to manage refs and invariants →
prisma-next-migration-review. - User wants to edit the contract →
prisma-next-contract. - User wants a deeper read of a single structured error envelope →
prisma-next-debug.
Key Concepts
db update(quick path). Reads the emitted contract, diffs against the live DB, applies the change. Optional--dry-runprints the plan without executing. Interactive destructive-op confirmation (or-yto auto-accept). Writes no migration directory. Operations needing data transforms are not handled by this path —db updateexcludes thedataoperation class entirely and short-circuits where a data transform would be required. Use only against a database that has no shared history with anyone else (your local dev DB).migration plan(formal path). Reads the emitted contract, diffs against the head of the on-disk migration graph, writes a new migration package undermigrations/app/<YYYYMMDDTHHMM>_<snake_slug>/. If any operation needs a data transform, the package'smigration.tscontainsplaceholder(...)calls you fill in.- The
app/segment in migration paths is the consuming application's contract-space id. Every migration you author lives undermigrations/app/. Extensions your contract depends on get their own sibling directories (migrations/<extension-space-id>/) — those are managed by the extension package and you don't write into them. Theapp/segment lands automatically the first time you runmigration plan/db initagainst an app-level config. - Migration package files (inside each
migrations/app/<dir>/):migration.json— manifest (metadata +migrationHash).ops.json— canonical operation list. Content-addressed;migrationHashis computed over this.migration.ts— TypeScript authoring source, framework-rendered bymigration plan(ormigration new). You edit specific holes in it (see Fill a placeholder below) and re-emitops.json/migration.jsonby running it.
- Contract snapshots.
migration.tsimports its bookend contracts from the shared, content-addressed store atmigrations/snapshots/<hex>/contract.json+contract.d.ts(<hex>is the contract's 64-hex storage hash) — not from files inside the migration package. - Self-emit. Running
node migrations/app/<dir>/migration.tsregeneratesops.jsonandmigration.jsonfrom the (possibly edited) TS source. This is the only supported way to update an existing migration package after edits. migration.tsshape. Framework-rendered. A class extendingMigration(from@prisma-next/family-mongo/migrationon Mongo, or re-exported via@prisma-next/postgres/migrationon Postgres — see the framing block below), with anoperationsgetter that returns an array of factory-call values. The file ends withMigrationCLI.run(import.meta.url, M)so executing it self-emits.placeholder(slot). A sentinel the planner emits into the renderedmigration.ts(from@prisma-next/errors/migrationon Mongo, or the@prisma-next/postgres/migrationimport on Postgres) wherever a data transform is needed. Callingplaceholder(...)at emit time throwsPN-MIG-2001Unfilled migration placeholder. The user replaces the() => placeholder(...)arrow with a real query-plan closure (Postgres) or fillsdataTransform({ check, run })sources (Mongo — see *F
Установить prisma-next-migrations в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл prisma-next-migrations?
Author Prisma Next migrations — choose db update vs migration plan, edit the framework-rendered migration.ts (replace placeholder sentinels with dataTransform closures), recover from MIGRATION.HASH_MISMATCH or PN-MIG-2001 unfilled placeholder. Use for prisma migrate dev, prisma migrate deploy, prisma db push, db update, db update --dry-run, migration plan, migrate, migration new, migration show, db verify, db sign, data migration, this.dataTransform, dataTransform, placeholder, generated migration.ts, edit migration.ts, MIGRATION.HASH_MISMATCH, schema drift.
Как установить скилл prisma-next-migrations?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл prisma-next-migrations запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic