Agent skill · data analytics · jeremylongshore

comparing-database-schemas

Process use when you need to work with schema comparison.

Why this skill is useful

Provides detailed automation scripts and commands for comparing and syncing database schemas that the AI wouldn't reliably generate on its own.

What it needs

Requires mysql, psql installed locally. About 4k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.

What this skill does

Database Diff Tool Overview Compare database schemas between two environments (development vs. staging, staging vs. Prerequisites Connection credentials to both source and target databases psql or mysql CLI configured to connect to both environments Read access to informationschema and pgcatalog (PostgreSQL) or informationschema (MySQL) Permission to run pgdump --schema-only for full schema extraction Understanding of which environment is the "source of truth" (typically the migration-managed environment) Instructions 1. Extract the full schema from both databases for comparison: PostgreSQL: pgdump --schema-only --no-owner --no-privileges -f schemasource.sql sourcedb and repeat for targetdb MySQL: mysqldump --no-data --routines --triggers sourcedb > schemasource.sql Alternatively, query informationschema directly for programmatic comparison 2. Compare tables present in each database: SELECT tablename FROM informationschema.tables WHERE tableschema = 'public' AND tablecatalog = 'sourcedb' EXCEPT SELECT tablename FROM informationschema.tables WHERE tableschema = 'public' AND tablecatalog = 'targetdb' This reveals tables that exist in source but not in target (and vice versa) 3. Compare columns for each shared table: Query informationschema.columns from both databases for: columnname, datatype, charactermaximumlength, isnullable, columndefault, ordinalposition Flag differences in data type, nullability, default values, and column ordering Detect added columns (in source, not target) and dropped columns (in target, not source) 4. Compare indexes: PostgreSQL: Query pgindexes for indexname, indexdef on each database MySQL: Query informationschema.STATISTICS for INDEXNAME, COLUMNNAME, NONUNIQUE Flag missing, extra, or differently-defined indexes 5. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills jeremylongshore/comparing-database-schemas

View the source on GitHub

Browse the @skills marketplace