Compare two databases
compare_schemasCompare table and column structure across two configured databases to find missing tables, missing columns, and type or nullability differences for migration checks or schema drift detection.
Instructions
Compares the table and column structure of two configured databases, such as development and production: tables present in only one, columns present in only one, and columns whose type or nullability differ, each with its type_declaration so a difference reads as 'nvarchar(250) vs nvarchar(50)'. Use it to check a migration or detect drift. It compares tables and columns only, not views, code, indexes or data; to see one differing table in full, call get_table_schema on each database.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source_schema | No | Source schema filter. Empty means every schema. | |
| target_schema | No | Target schema filter. Empty means every schema. | |
| source_database | Yes | Source database name as registered in configuration. | |
| target_database | Yes | Target database name as registered in configuration. |