Schema Comparator
Developmentschema-comparatorSchema Comparator is an Agent Skill for development published in the a5c-ai/babysitter repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Compare database schemas between source and target environments for migration planning
QUICK START
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/a5c-ai/babysitter/blob/HEAD/library/specializations/code-migration-modernization/skills/schema-comparator/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/schema-comparator, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Schema Comparator Skill
Compares database schemas between source and target environments to identify differences and generate migration scripts.
Purpose
Enable database migration planning for:
- Schema diff generation
- Data type mapping
- Constraint comparison
- Index analysis
- Migration script generation
Capabilities
1. Schema Diff Generation
- Compare table structures
- Identify column differences
- Detect missing objects
- Generate change reports
2. Data Type Mapping
- Map types across databases
- Handle type conversions
- Identify precision changes
- Document compatibility
3. Constraint Comparison
- Compare primary keys
- Analyze foreign keys
- Check unique constraints
- Verify check constraints
4. Index Analysis
- Compare index definitions
- Identify missing indexes
- Analyze index usage
- Recommend optimizations
5. Stored Procedure Comparison
- Compare procedure signatures
- Identify logic differences
- Detect parameter changes
- Flag deprecated procedures
6. Migration Script Generation
- Generate DDL scripts
- Create rollback scripts
- Handle dependencies
- Order changes correctly
Tool Integrations
| Tool | Databases | Integration Method |
|---|---|---|
| Flyway | Multi | CLI |
| Liquibase | Multi | CLI |
| Redgate SQL Compare | SQL Server | CLI |
| SchemaHero | Kubernetes | CLI |
| pgdiff | PostgreSQL | CLI |
| mysqldiff | MySQL | CLI |
Output Schema
{
"comparisonId": "string",
"timestamp": "ISO8601",
"source": {
"type": "string",
"connection": "string"
},
"target": {
"type": "string",
"connection": "string"
},
"differences": {
"tables": {
"added": [],
"removed": [],
"modified": []
},
"columns": [],
"constraints": [],
"indexes": [],
"procedures": []
},
"migration": {
"scripts": [],
"order": [],
"rollback": []
}
}
Integration with Migration Processes
- database-schema-migration: Primary comparison tool
- data-format-migration: Schema analysis
Related Skills
data-migration-validator: Post-migration validationquery-translator: SQL conversion
Related Agents
database-migration-orchestrator: Uses for planningdata-architect-agent: Schema design review