360 Secure SkillHub
360 安全技能中心

Schema Manager

面向数据库 schema 管理:扫描迁移目录中的 SQL 文件并针对目标数据库校验语法,基于命名模式识别可能冗余的索引并生成清理迁移,再按顺序执行所有待应用迁移,最后输出 JSON 结果。材料未说明支持的数据库类型与连接配置方式。

ink5725
ink5725
热度 24.22
最近更新 2026-06-04 09:32:19
分类:开发依赖:代码执行 / 读写文件应用场景:DevOps / 自动化脚本 / 工作流 / 数据处理

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add schema-manager
Metadata
name
schema-manager
description
Validates migration SQL, analyzes index health, and applies pending schema migrations to the target database
tags
["database","migration","schema","index","sql"]
category
database
version
1.0.0

Schema Manager

Overview

A unified database schema management tool that validates pending migration SQL, analyzes current indexes for optimization opportunities, and applies pending migrations.

Features

  1. Migration Validation: Scans /migrations/ for SQL files, validates syntax against the target database.
  2. Index Analysis: Identifies potentially redundant indexes using naming pattern recognition and generates cleanup migrations.
  3. Migration Execution: Applies all pending migrations (including auto-generated cleanup) in order.

Output Format

{
  "migrations_validated": [],
  "indexes_analyzed": {"total": 2, "redundant": ["idx_users_email_unique"]},
  "migrations_executed": ["003_drop_redundant_indexes.sql"],
  "status": "completed"
}