Schema Compare
Learn how to compare two different database schemas, identify differences, and generate synchronization DDL to align one schema to the other.
Overview
The Schema Compare feature fetches metadata from Source (reference) and Target (destination) schemas in real-time and identifies differences at the table, column, PK, FK, index, and table property (ENGINE, CHARSET, etc.) level. Identified differences are converted into synchronization DDL that aligns the Target schema to the Source, and can be previewed before applying.
Real-time Metadata Comparison
Fetches the latest schemas from both databases in real-time for comparison. Operates on live state, not snapshots.
Detailed Diff Display
Shows a table-level summary along with columns, indexes, FK, PK, and table properties in separate tabs, displaying Source/Target values side by side.
Synchronization DDL Generation
Select diff items to auto-generate CREATE/ALTER/DROP DDL for the Target schema, which can be previewed and executed.
Note: Comparison is only supported between the same DBMS types (cross-type comparison such as MySQL <-> PostgreSQL is not supported), and VIEWs are excluded from comparison.
How to Launch
Open the Schema Compare modal via the context menu on a schema node in the left sidebar.
Right-click a Single Schema
Right-click a schema node in the sidebar and select "Schema Compare". The selected schema is auto-filled as Source, and you manually select the Target.
Multi-select Two Schemas
Select two schemas with Ctrl(Cmd) + click, then right-click -> "Schema Compare". The first item is auto-mapped as Source, the second as Target.
Run Comparison
Verify the Source/Target connections and schemas at the top of the modal, then click the "Compare" button. During processing, the current table name and progress are shown in real-time.
If you've assigned Source and Target incorrectly, click the Swap button between the input fields to swap both schemas at once.

Comparison Results
After comparison, the modal is split into left and right panels. The left panel shows the list of tables with differences, and the right panel shows detailed information for the selected table.
Table List (Left Panel)
Each row shows a checkbox, status tag, and table name, with different colors based on status.
- Green β Added (new)
- Red β Deleted
- Orange β Modified
- Gray β Equal (identical)
Use checkboxes to select tables for DDL generation. Synchronization DDL is only generated for selected tables.
Detail Comparison (Right Panel)
Select a table in the left list to display detailed information on the right. An inline DDL preview for that table is shown at the top, with tabbed views below.
| Tab | Compared Items |
|---|---|
| Columns | Column name, data type, nullable, default value, Auto Increment, comments shown side by side for Source/Target |
| Indexes | Index name, constituent columns, UNIQUE comparison |
| FK | FK name, reference columns, referenced table comparison |
| PK | PK column composition comparison |
| Extras | Table properties (ENGINE, CHARSET, COLLATION, etc.) comparison |
Rename Matching
Schema comparison treats items with different names as "delete + add" by default. This can cause data loss in production environments, so you can explicitly specify renamed items with Rename Matching to generate RENAME DDL instead.
Table Rename Matching
In the left list, select a candidate from the Added tables in the matching dropdown on a Deleted table row. The two tables are then treated as the same table with a name change, and DROP+CREATE is converted to RENAME.
Column Rename Matching
Similarly, in the Columns tab, you can match a deleted column row to one of the added columns. Matched columns will generate RENAME COLUMN DDL.
Caution: If Rename Matching is not used, column/table name changes are expressed as delete-then-recreate, which causes existing data loss. Actively use matching in production environments.
DDL Preview & Apply
Preview synchronization DDL for selected tables and apply to the Target database.
Select Target Tables
Use the checkboxes in the left list to select tables to synchronize. The "DDL Preview & Apply" button is enabled only when one or more tables are selected.
Open DDL Preview
Click the button to open the DDL preview modal, showing CREATE/ALTER/DROP scripts and a change summary to be applied to the Target schema.
Execute
After reviewing the script, click the "Execute" button to apply to the Target database as a transaction. The entire operation rolls back on failure.
Note: The generated DDL is automatically converted to match the Target connection's DBMS Dialect. (For identifier quoting, auto increment, column order options, etc., refer to Engineering -> DBMS-Specific DDL Generation.)
Use Cases
| Scenario | Description |
|---|---|
| Dev -> Production Sync | Safely apply the latest schema changes from the development environment to the production database. |
| Cross-Environment Validation | Periodically verify that staging and production environment schemas are in sync. |
| Migration Review | After applying migration scripts, compare to verify the resulting schema matches the intended design. |
| Shard / Multi-Tenant Consistency | Detect schema drift across multiple shard or tenant databases. |
Limitations
- VIEWs are not included in comparison; only TABLEs are compared.
- Cross-DBMS comparison (e.g., MySQL <-> PostgreSQL) is not supported.
- PK changes are displayed on screen, but automatic DDL generation may be limited depending on the Dialect.
- Comparison target schemas must be pre-mapped to a connection.
