← 返回
开发者工具 中文

Prisma Migrate Guard

Preflight Prisma migration state before deploy; fails fast on drift, failed migrations, missing DB URLs, or unapplied migration files.
部署前预检查 Prisma 迁移状态,检测漂移、失败迁移、缺失数据库 URL 或未应用的迁移文件,快速报错。
daniellummis
开发者工具 clawhub v1.0.0 1 版本 99798 Key: 无需
★ 0
Stars
📥 494
下载
💾 6
安装
1
版本
#latest

概述

Prisma Migrate Guard

Use this skill before deploys or CI release steps to verify Prisma migrations are healthy and ready to apply.

What this skill does

  • Verifies required Prisma CLI/runtime tools are available
  • Validates migration DB URL inputs (DATABASE_URL by default)
  • Runs prisma migrate status against a target schema
  • Fails on common dangerous states:
  • failed migrations
  • migration drift warnings
  • unapplied migration files
  • missing migration history table hints
  • Exits non-zero for CI/deploy gating

Inputs

  • Optional env vars:
  • PRISMA_SCHEMA_PATH (default: prisma/schema.prisma)
  • PRISMA_MIGRATE_DB_URL_ENV (default: DATABASE_URL)
  • PRISMA_MIGRATE_GUARD_ALLOW_UNAPPLIED (1 to warn instead of fail)
  • PRISMA_MIGRATE_GUARD_ALLOW_DRIFT (1 to warn instead of fail)

Run

bash scripts/check-prisma-migrate.sh

With explicit schema and env key:

PRISMA_SCHEMA_PATH=apps/api/prisma/schema.prisma \
PRISMA_MIGRATE_DB_URL_ENV=POSTGRES_PRISMA_URL \
bash scripts/check-prisma-migrate.sh

Output contract

  • Prints a concise PASS/FAIL report
  • Exit code 0 on healthy status
  • Exit code 1 on blocking migration issues

Notes

  • This guard is read-only (migrate status), it does not apply migrations.
  • Keep it in CI before deploy or startup migration steps.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 13:53 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 668 📥 324,172
developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 921 📥 185,801
security-compliance

GitHub Actions Trigger Health Audit

daniellummis
审计 GitHub Actions 运行状态,按触发事件和工作流划分,快速定位并优先处理不稳定的自动化源。
★ 0 📥 716