Token导航 LogoToken导航

Agent Skill · 开发

database-schema-differ(数据库架构不同)

用于辅助数据库表结构、查询语句、迁移脚本和数据维护任务。它适合让 Agent 分析 schema、编写 SQL、排查查询问题、整理索引或生成迁移建议。使用时需要明确数据库类型、连接环境和目标表,区分只读分析与写入变更;涉及删除、更新、迁移和批量导入时,应优先 dry-run、备份或事务保护,避免误操作。

database-schema-differ 是开发类 Agent Skill,可用宿主为 OpenClaw,通过ClawHub获取,权限为接触敏感数据;许可证为 MIT-0,第三方扫描有提醒项,按安装量在开发类的 21,746 个 Skill 里排第 4,036。

总安装 9,278周安装 379GitHub Stars 公开资料未说明下载 2,971核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT-0
版本
1.0.0

安装方式

通过对话安装

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

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

命令行安装

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

ClawHubOpenClaw
openclaw skills install database-schema-differ

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

用于跨环境比较数据库架构差异。适用宿主包括 OpenClaw,接入前应确认版本、权限和运行环境要求。自动生成迁移脚本并跟踪架构演变。适合多环境部署与版本控制场景。安装方式:clawhub,仅适用于 OpenClaw。需确保源与目标数据库可连接。

database-schema-differ 属于开发类 Skill,可作为该场景下的辅助能力补充。

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 OpenClaw;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 openclaw skills install database-schema-differ;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

database-schema-differ 怎么安装?

在终端执行 openclaw skills install database-schema-differ。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

database-schema-differ 支持哪些 AI 工具?

公开资料标注支持 OpenClaw。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

database-schema-differ 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

database-schema-differ 是免费的吗?

来源标注的许可证是 MIT-0。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

database-schema-differ 用的人多吗?

公开数据是累计安装 9,278 次,近一周安装 379 次,下载 2,971 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

database-schema-differ 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 专注 OpenClaw 一种宿主,触发方式和使用习惯不用来回切换。
  • 许可证明确为 MIT-0,商用和分发边界好判断。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 OpenClaw,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
database-schema-differ

数据库架构不同 · 本页

9,278—接触敏感数据MIT-0有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

name
database-schema-differ
description
Compare database schemas across environments, generate migration scripts, and track schema evolution.
version
1.0.0
author
skill-factory
metadata
openclaw
requires
bins
python

Database Schema Differ

What This Does

A CLI tool to compare database schemas across different environments (development, staging, production), generate migration scripts, and track schema evolution over time. Support for PostgreSQL, MySQL, SQLite, and other databases via SQLAlchemy.

Key features:

  • Schema comparison: Compare schemas between databases, branches, or points in time
  • Migration generation: Automatically generate SQL migration scripts (up/down) for schema changes
  • Schema snapshots: Capture and store schema snapshots for historical comparison
  • Drift detection: Identify schema drift between environments (dev vs prod, etc.)
  • Multiple database support: PostgreSQL, MySQL, SQLite, SQL Server, Oracle via SQLAlchemy
  • Export formats: Generate SQL, JSON, or visual diff outputs
  • Integration ready: Works with Alembic, Django migrations, or standalone
  • Change tracking: Track schema evolution over time with versioning
  • CI/CD friendly: Output machine-readable formats for automation pipelines

When To Use

  • You need to compare database schemas between development and production
  • You want to generate migration scripts for schema changes
  • You're managing multiple database environments and need to ensure consistency
  • You need to detect schema drift in production databases
  • You're refactoring databases and need to track changes
  • You want to automate schema validation in CI/CD pipelines
  • You need to document schema changes for compliance or team coordination
  • You're onboarding new team members and need to understand schema evolution
  • You want to visualize schema differences between branches or versions

Usage

Basic commands:

# Compare two database connections
python3 scripts/main.py compare postgresql://user:pass@host1/db postgresql://user:pass@host2/db

# Generate migration script from schema differences
python3 scripts/main.py diff dev_db.sql prod_db.sql --output migration.sql

# Create schema snapshot for future comparison
python3 scripts/main.py snapshot postgresql://user:pass@host/db --save snapshot.json

# Compare current schema with saved snapshot
python3 scripts/main.py compare-snapshot postgresql://user:pass@host/db snapshot.json

# Generate visual diff between schemas
python3 scripts/main.py visual-diff schema1.sql schema2.sql --html diff.html

# Check for schema drift in CI pipeline
python3 scripts/main.py check-drift --expected expected_schema.json --actual actual_schema.json

# Track schema evolution over time
python3 scripts/main.py history postgresql://user:pass@host/db --days 30

Examples

Example 1: Compare development and production databases

python3 scripts/main.py compare \
  postgresql://dev_user:dev_pass@localhost/dev_db \
  postgresql://prod_user:prod_pass@prod-host/prod_db \
  --output diff-report.json

Output:

🔍 Comparing schemas: dev_db (localhost) vs prod_db (prod-host)

📊 Summary:
- Tables: 42 vs 45 (3 missing in dev)
- Columns: 287 vs 295 (8 differences)
- Indexes: 67 vs 72 (5 differences)
- Constraints: 34 vs 38 (4 differences)

⚠️  Differences found (15):
1. Table `audit_logs` missing in dev
   → CREATE TABLE audit_logs (...)
   
2. Column `users.email_verified` missing in dev
   → ALTER TABLE users ADD COLUMN email_verified BOOLEAN DEFAULT FALSE
   
3. Index `idx_users_email` missing in prod
   → CREATE INDEX idx_users_email ON users(email)
   
4. Constraint `fk_orders_customer_id` differs
   → ALTER TABLE orders DROP CONSTRAINT fk_orders_customer_id_old;
   → ALTER TABLE orders ADD CONSTRAINT fk_orders_customer_id FOREIGN KEY ...

✅ Generated migration: diff-report.json
✅ SQL migration script: migration_20240306_143022.sql

Example 2: Generate migration script

python3 scripts/main.py diff old_schema.sql new_schema.sql --format sql --output migration.sql

Output (migration.sql):

-- Generated: 2024-03-06 14:30:22
-- Database: PostgreSQL

-- UP Migration
CREATE TABLE audit_logs (
    id SERIAL PRIMARY KEY,
    user_id INTEGER,
    action VARCHAR(255),
    created_at TIMESTAMP DEFAULT NOW()
);

ALTER TABLE users ADD COLUMN email_verified BOOLEAN DEFAULT FALSE;

CREATE INDEX idx_users_email ON users(email);

ALTER TABLE orders 
    DROP CONSTRAINT fk_orders_customer_id_old,
    ADD CONSTRAINT fk_orders_customer_id 
    FOREIGN KEY (customer_id) REFERENCES customers(id) 
    ON DELETE CASCADE;

-- DOWN Migration (rollback)
DROP TABLE IF EXISTS audit_logs;

ALTER TABLE users DROP COLUMN IF EXISTS email_verified;

DROP INDEX IF EXISTS idx_users_email;

ALTER TABLE orders 
    DROP CONSTRAINT fk_orders_customer_id,
    ADD CONSTRAINT fk_orders_customer_id_old 
    FOREIGN KEY (customer_id) REFERENCES customers(id);

Example 3: Check for schema drift in CI

python3 scripts/main.py check-drift \
  --expected schemas/expected/prod.json \
  --actual schemas/actual/prod.json \
  --fail-on-drift

Output (CI failure):

❌ Schema drift detected!

Differences:
1. Unexpected table `temp_backup` in production
2. Missing index `idx_orders_status` in production
3. Column `users.last_login` has different type (TIMESTAMP vs TIMESTAMPTZ)

Exit code: 1 (failed due to --fail-on-drift)

Example 4: Track schema evolution

python3 scripts/main.py history postgresql://user:pass@host/db --days 90 --format timeline

Output:

📅 Schema Evolution Timeline (last 90 days)

2024-03-05: Added audit_logs table (v4.2.0 release)
2024-02-28: Added email_verified column to users table
2024-02-15: Created indexes for performance optimization  
2024-02-01: Added foreign key constraints for data integrity
2024-01-20: Initial schema snapshot (v4.0.0)

📈 Change Statistics:
- Tables: +3 (42 → 45)
- Columns: +23 (272 → 295)
- Indexes: +8 (64 → 72)
- Avg changes per week: 2.1

Example 5: Visual schema comparison

python3 scripts/main.py visual-diff schema_v1.sql schema_v2.sql --html schema_diff.html

Output:

✨ Generated visual diff: schema_diff.html

Open in browser to see:
- Side-by-side schema comparison
- Color-coded differences (added/removed/changed)
- Interactive expand/collapse for tables
- Export options for documentation

Differences highlighted:
✅ 5 tables added (green)
❌ 2 tables removed (red)  
🔄 12 columns modified (yellow)

Requirements

  • Python 3.x
  • SQLAlchemy (for database connectivity)
  • Alembic (optional, for migration generation)
  • Database drivers: psycopg2 (PostgreSQL), pymysql (MySQL), etc.

Install dependencies:

pip3 install sqlalchemy alembic psycopg2-binary pymysql

Limitations

  • Requires database credentials and network access to compare live databases
  • Complex schema changes may require manual review of generated migrations
  • Limited support for database-specific features not covered by SQLAlchemy
  • Performance may be impacted with very large schemas (1000+ tables)
  • No built-in support for NoSQL databases (MongoDB, Redis, etc.)
  • Cannot compare encrypted or compressed database dumps
  • Limited error handling for connection issues or permission problems
  • No support for comparing materialized views or database functions across all DB types
  • Generated migrations may not handle data migration or complex transformation
  • No built-in support for distributed database comparisons
  • Limited to schema structure; does not compare data or indexes optimally
  • May not detect all schema differences for databases with custom types or extensions
  • No support for comparing database triggers or stored procedures across all database types
  • Performance may degrade with very large tables or complex relationships
  • No built-in support for schema version control systems (like Liquibase or Flyway)
  • Limited error recovery for malformed SQL or corrupted schema files
  • No support for real-time schema change monitoring
  • Cannot compare schemas across different database types (e.g., PostgreSQL vs MySQL)
  • Limited support for database-specific optimizations or extensions
  • No built-in notification system for schema drift alerts
  • May require manual adjustment of generated migration scripts for production use

Directory Structure

The tool works with database connection strings, SQL files, or schema snapshot files. No special configuration directories are required.

Error Handling

  • Invalid database connections show helpful error messages with connection details
  • Permission errors suggest checking database credentials and access rights
  • Schema parsing errors show line numbers and specific SQL issues
  • Comparison errors suggest checking schema compatibility or database versions
  • File not found errors suggest checking paths and file permissions
  • Output generation errors suggest checking disk space and write permissions

Contributing

This is a skill built by the Skill Factory. Issues and improvements should be reported through the OpenClaw project.

平台分布

OpenClaw

98.89%
按下载量换算2,938

安全审计

VirusTotal

通过

ClawScan

可疑

Static analysis

通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills