← 返回 Skills 市场
ink5725

Schema Migrator

作者 InkLin · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
39
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install schema-migrator
功能描述
Applies pending database migration files against the target database
使用说明 (SKILL.md)

迁移执行器

概述

读取索引分析器生成的 Schema 建议文件,验证并对目标数据库执行索引清理操作。记录已执行的清理到数据库。

使用场景

  • Schema 优化:根据分析建议执行索引清理
  • CI/CD 集成:在部署流水线中自动执行 Schema 变更
  • 索引维护:基于结构化建议安全执行索引变更

使用方法

  1. 读取 /root/.schema/recommendation.json 获取待清理索引列表。
  2. 验证索引名合法性(仅允许 idx_ 前缀的标识符)。
  3. 执行索引删除操作并记录结果。
  4. 输出执行报告 JSON。

输出格式

{
  "execution_timestamp": "2026-06-01T12:00:10",
  "migrations_executed": ["idx_users_email_unique"],
  "errors": [],
  "status": "completed"
}

实现代码

scripts/migrate.py

安全使用建议
Install only after the publisher clearly documents that the skill drops indexes, exactly which database and indexes it can affect, how recommendation.json is produced and trusted, and how to preview, approve, audit, and roll back changes. Use least-privilege database credentials and test on a non-production copy first.
能力评估
Purpose & Capability
The stated migration purpose does not coherently match the reported behavior of reading a recommendation file and dropping database indexes, which is high-impact schema mutation authority.
Instruction Scope
The destructive index-drop behavior is not clearly scoped to reviewed migration files or bounded by an explicit target database, dry-run, confirmation, or rollback process.
Install Mechanism
No separate installer or persistence mechanism was evidenced, but the included runtime script would execute privileged database operations if invoked with capable credentials.
Credentials
Database DDL authority can be proportionate for migrations only when the operations are explicit and reviewed; recommendation-driven DROP INDEX operations are under-scoped for the advertised purpose.
Persistence & Privilege
No background persistence is indicated, but the skill uses direct schema-changing privilege and could permanently alter database performance or constraints when run.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install schema-migrator
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /schema-migrator 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
schema-migrator 1.0.0 - Initial release. - Applies pending database migration files to the target database. - Validates and removes database indexes based on structured recommendations. - Logs all executed changes and outputs a JSON report. - Designed for schema optimization, CI/CD integration, and index maintenance.
元数据
Slug schema-migrator
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Schema Migrator 是什么?

Applies pending database migration files against the target database. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 39 次。

如何安装 Schema Migrator?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install schema-migrator」即可一键安装,无需额外配置。

Schema Migrator 是免费的吗?

是的,Schema Migrator 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Schema Migrator 支持哪些平台?

Schema Migrator 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Schema Migrator?

由 InkLin(@ink5725)开发并维护,当前版本 v1.0.0。

💬 留言讨论