Screens: Connections and explorer

Schema compare

The Schema Compare dialog reads the real database structure of two schemas (Source and Target), shows how their tables and views differ, and builds DDL that makes Target match the differences you pick. Use it to see what differs before you move structure changes from a development database to production. Differences between a saved table design and the database are handled by the Apply changes to the database dialog, not this one.

Where you can use itWebDesktopWithout signing inSigned inLocal projectsAccount projects

What's on the screen

No.NameDescription
1SourceThe schema used as the reference. Choose a connection, then one of the schemas added to that connection.
2TargetThe schema to bring in line with Source. Only connections of the same DBMS as Source are listed. The DDL that is built runs in this schema.
3Compare buttonReads the table and view structure of both schemas from the database and compares them. The arrow button next to it (Swap Source ↔ Target) swaps Source and Target.
4SummaryThe number of New, Drop, Modified and Equal objects. Turn on Show equal objects to list identical objects too.
5Objects listTables and views that differ. The tags mark objects to create in Target (CREATE), to change (ALTER) and to drop (DROP). DDL is built only for checked objects.
6Detailed comparisonThe selected object's DDL and the item-by-item differences on the Columns, Indexes, FK, PK and Constraints tabs. Tabs with differences have a dot.
7DDL Preview & Apply buttonCollects the DDL of the checked objects and opens the apply dialog.

Compare two schemas

  1. In the object explorer, right-click a schema and choose Explorer context menuSchema Compare.... The schema you right-clicked becomes Source.
  2. Choose a connection and schema under Target (2).
  3. Click the Compare button (3). The progress display shows how many tables have been read from each schema. When it finishes, the objects that differ appear in the list (5), all checked.
  4. Click an object in the list to see what differs on the right (6). The Columns tab shows type, Nullable, Default, Comment and more side by side for Source and Target.

If you select two schemas of the same DBMS together in the explorer (click while holding Ctrl or Cmd) and right-click, the first schema becomes Source, the second becomes Target, and the comparison starts right away. If the schemas belong to different DBMSs, the menu is dimmed and Schema comparison is supported only between the same DBMS. is shown.

Apply the differences to Target

  1. Uncheck the objects in the list (5) that you don't want to apply this time.
  2. If a renamed table or column shows up as two rows, DROP and CREATE, choose the new name in the Rename match box on the DROP row. The two rows merge into one and DDL that only renames is built.
  3. Click the DDL Preview & Apply button (7). The apply dialog opens with the Target connection as its target.
  4. Check the DDL in the apply dialog and run it. Running and requesting approval are described in Apply changes to the database.
  5. When it finishes, DDL applied successfully. is shown and this dialog compares the two schemas again.

What is compared

ObjectItems compared
TablesColumns (type, order, Nullable, Default, character set and collation, generated columns, IDENTITY, Comment and more), indexes, FKs, PK, constraints, table properties
ViewsDefinition, columns, view properties
PostgreSQL tablesIn addition, the RLS Policies and Publications tabs
  • Only tables and views are compared. Other objects such as sequences, functions, procedures and triggers are not.
  • Objects are paired by name. An object only in Source is CREATE, one only in Target is DROP, and one in both that differs is ALTER.
  • If a view difference is a kind that can't be changed automatically, the detailed comparison shows a Changes requiring manual action box. Handle that change yourself.

Things to keep in mind

  • This dialog reads the real databases of both schemas. Design changes saved in the project but not yet applied to the database are not part of the comparison.
  • Only schemas of the same DBMS can be compared. Within one connection, choose two different schemas (Source and target must be different schemas.).
  • Only schemas added to the project's connections are listed. If the schema you want isn't there, add it to the connection first (Create and edit a connection).
  • A renamed column or table that you don't pair up becomes DDL that drops it and creates it again. Running it loses the data in that column or table. The warning text at the top of the dialog says so too. Check the Rename match boxes before you run it.
  • Objects that exist only in Target are listed as DROP and checked. When Target is a production database, uncheck anything that must not be dropped.
  • If Target is a Databricks foreign catalog, the DDL Preview & Apply button can't be clicked. You can only compare.