Token导航 LogoToken导航TokenDH.com
研究检索需要联网clawhub未标认证来源可访问clear审计通过

migratesafemigratesafe 数据库

Agent Skill

migratesafe 用于查找、检索和筛选相关信息,适合在 OpenClaw 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

2,756

周安装

116

GitHub Stars

公开资料未说明

下载量

965
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:migratesafe(migratesafe 数据库)
来源仓库:https://github.com/suhteevah/migratesafe
安装命令:
openclaw skills install migratesafe
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install migratesafe

简介

数据库迁移安全检查器,在破坏性迁移到达生产环境之前捕获它们。

  • 适用于数据库迁移安全检查和风险控制。
  • 使用 openclaw skills install migratesafe 命令安装。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。
  • 适用宿主包括 OpenClaw,接入前应确认版本、权限和运行环境要求。

SKILL.md

name
migratesafe
description
Database migration safety checker — catches destructive migrations before they reach production
homepage
https://migratesafe.pages.dev
metadata
user-invocable
true
disable-model-invocation
false

MigrateSafe — Database Migration Safety Checker

MigrateSafe analyzes database migration files for destructive operations before they reach production. It detects DROP TABLE, column removals, risky type changes, missing rollbacks, lock hazards, and unsafe ALTER operations across raw SQL, Rails, Django, Knex.js, Prisma, Flyway, and Liquibase migrations. It uses regex-based pattern matching with risk scoring and produces compliance reports.

Commands

Free Tier (No license required)

migratesafe scan [file|directory]

One-shot scan of migration files for destructive operations.

How to execute:

bash "<SKILL_DIR>/scripts/migratesafe.sh" scan [target]

What it does:

  1. Accepts a file path or directory (defaults to current directory)
  2. Auto-detects migration framework (SQL, Rails, Django, Knex, Prisma, Flyway, Liquibase)
  3. Finds all migration files in standard locations (db/migrate, migrations/, prisma/migrations, sql/)
  4. Runs 15+ destructive operation patterns against each file
  5. Calculates a risk score (0-100) per file and overall
  6. Outputs findings with: file, line number, severity, operation, recommendation
  7. Exit code 0 if safe, exit code 1 if critical/high risk operations detected
  8. Free tier limited to 3 migration files per scan

Example usage scenarios:

  • "Check my migrations for destructive operations" -> runs migratesafe scan .
  • "Is this migration safe to deploy?" -> runs migratesafe scan db/migrate/20240115_add_users.sql
  • "Scan my SQL files for DROP statements" -> runs migratesafe scan migrations/

migratesafe help

Show available commands and usage information.

bash "<SKILL_DIR>/scripts/migratesafe.sh" help

migratesafe version

Show version information.

bash "<SKILL_DIR>/scripts/migratesafe.sh" version

Pro Tier ($19/user/month -- requires MIGRATESAFE_LICENSE_KEY)

migratesafe hooks install

Install git pre-commit hooks that scan staged migration files before every commit.

How to execute:

bash "<SKILL_DIR>/scripts/migratesafe.sh" hooks install

What it does:

  1. Validates Pro+ license
  2. Copies lefthook config to project root
  3. Installs lefthook pre-commit hook
  4. On every commit: scans all staged migration files, blocks commit if critical/high risk, shows remediation advice

migratesafe hooks uninstall

Remove MigrateSafe git hooks.

bash "<SKILL_DIR>/scripts/migratesafe.sh" hooks uninstall

migratesafe rollback-check [directory]

Verify that every UP migration has a corresponding DOWN/rollback migration.

bash "<SKILL_DIR>/scripts/migratesafe.sh" rollback-check [directory]

What it does:

  1. Validates Pro+ license
  2. Scans migration directories for UP migrations
  3. Checks for corresponding rollback/down files or reversible blocks
  4. Reports missing rollbacks with severity assessment

migratesafe diff <file1> <file2>

Compare two schema versions and highlight dangerous changes.

bash "<SKILL_DIR>/scripts/migratesafe.sh" diff schema_v1.sql schema_v2.sql

What it does:

  1. Validates Pro+ license
  2. Compares two SQL schema files
  3. Identifies dropped tables, removed columns, type changes
  4. Shows side-by-side diff with risk annotations

Team Tier ($39/user/month -- requires MIGRATESAFE_LICENSE_KEY with team tier)

migratesafe history [directory]

Show migration risk history across all migrations in the project.

bash "<SKILL_DIR>/scripts/migratesafe.sh" history [directory]

What it does:

  1. Validates Team+ license
  2. Scans all migration files chronologically
  3. Builds a risk timeline showing when dangerous migrations were introduced
  4. Reports cumulative risk score and trends

migratesafe report [directory]

Generate a full compliance report in markdown format.

bash "<SKILL_DIR>/scripts/migratesafe.sh" report [directory]

What it does:

  1. Validates Team+ license
  2. Runs full scan of all migration files
  3. Generates a formatted markdown report from template
  4. Includes per-file breakdowns, risk scores, recommendations, rollback status
  5. Output suitable for compliance audits and change advisory boards

Detected Destructive Operations

MigrateSafe detects 15+ destructive patterns across 7 migration frameworks:

CategoryExamplesSeverity
Table DropsDROP TABLE, drop_table, DeleteModel, dropTableCritical
TruncationTRUNCATE TABLE, unconditional DELETE FROMCritical
Column DropsDROP COLUMN, remove_column, RemoveField, dropColumnHigh
Type ChangesALTER COLUMN...TYPE, change_column, AlterFieldHigh
Constraint RemovalDROP CONSTRAINT, DROP INDEX, RemoveConstraint, remove_indexHigh
NOT NULL AdditionsSET NOT NULL (without DEFAULT), add non-null columnMedium
Missing TransactionsMigrations not wrapped in BEGIN/COMMITMedium
Lock HazardsCREATE INDEX (without CONCURRENTLY), ALTER TABLE on large tablesMedium
Cascade DeletesON DELETE CASCADE, CASCADE changesMedium
Column RenamesRENAME COLUMN, rename_column, RenameFieldLow
Data Loss RiskREPLACE operations, ON DELETE SET NULL changesLow

Supported Migration Frameworks

FrameworkFile PatternDetection
Raw SQL*.sqlFull SQL pattern matching
Railsdb/migrate/*.rbremove_column, drop_table, change_column, etc.
Djangomigrations/*.pyRemoveField, DeleteModel, AlterField, etc.
Knex.jsmigrations/*.js/*.tsdropTable, dropColumn, raw.*DROP, etc.
Prismaprisma/migrations/*.sqlFull SQL pattern matching
Flywaysql/V*.sqlFull SQL pattern matching
Liquibase*.xml changesetsdropTable, dropColumn, modifyDataType, etc.

Configuration

Add to ~/.openclaw/openclaw.json:

{
  "skills": {
    "entries": {
      "migratesafe": {
        "enabled": true,
        "apiKey": "YOUR_LICENSE_KEY",
        "config": {
          "severityThreshold": "high",
          "migrationDirs": ["db/migrate", "migrations", "prisma/migrations", "sql"],
          "ignorePatterns": ["**/test/**", "**/seed/**"],
          "requireRollbacks": true,
          "blockOnCritical": true
        }
      }
    }
  }
}

Important Notes

  • Free tier works immediately -- no configuration needed
  • All scanning happens locally -- no code or schema data sent to external servers
  • License validation is offline -- no phone-home or network calls
  • Supports multiple migration frameworks in the same project
  • Risk scores are cumulative -- a file with multiple issues scores higher
  • Git hooks use lefthook which must be installed (see install metadata above)
  • Exit codes: 0 = safe, 1 = dangerous operations detected (for CI/CD integration)

Error Handling

  • If lefthook is not installed and user tries hooks install, prompt to install it
  • If license key is invalid or expired, show clear message with link to https://migratesafe.pages.dev/renew
  • If no migration files found in target, report clean scan with info message
  • If a file is binary, skip it automatically with no warning
  • If migration framework cannot be determined, fall back to raw SQL pattern matching

When to Use MigrateSafe

The user might say things like:

  • "Check my migrations for destructive operations"
  • "Is this migration safe to run?"
  • "Scan for DROP TABLE statements"
  • "Verify my rollback migrations exist"
  • "Generate a migration safety report"
  • "Set up pre-commit hooks for migrations"
  • "Check if this schema change is dangerous"
  • "Block destructive migrations from being committed"
  • "Compare two schema versions"
  • "Show migration risk history"

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

71.44%
按下载量换算689

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills