You can compare two schema/database structures and generate a report in the following formats:
- DDL script (series of create/alter/drop statements)
- Diff diagram (sort of ER diagram)
- Liquibase changelog
- Liquibase change report (JSON, YAML, or plaintext)
Selecting objects to compare
- Select the two objects (schemas, databases, or tables) you want to compare
- Open the context menu
- Open the sub-menu
- Click on
Re-validate that you have chosen the correct objects to compare. You can also specify the types of changes to be processed: create, drop, or alter. By default, all kinds of changes are enabled.
For comparisons, table containers should be used. Schemes - if the database supports the schemas. Databases - if the database supports catalogs and does not support the schemes. Datasources - if there is no support schemas or catalog support (you can find an example below in "Compare schemaless bases").
You can exclude the specific compared types of objects.
For example, you can do this if you do not want to see the sequences, views, or external keys in the final comparison result.
Compare Schemas to generate a diff report.
By default, DDL diff is generated. It contains a series of creating, alter and/or drop statements that will modify the schema on the right side. Thus it will make it identical to the schema on the left side.
You can enable/disable certain changes in the tree on the left side of the diff page:
You can also switch to another diff report representation (diagram, JSON, YAML, plaintext).
To get acquainted with the comparison logs, you first specify the logging level on the Preferences-> Editors-> Schema Compare preference page. Specify one of the logging levels and click on
Apply. By default, the logging level is the OFF level. To get complete information, you can choose the DEBUG level.
After comparing operations, you can click on the
Show log button. A log will be open in the Editor, and the content of this log will depend on the logging level you choose in the settings. Log level сhanges from preferences will not be applied to the comparison wizard if it is already open in another window. Close and open the schema compare wizard in this case.
Compare schemaless bases
Some bases (like SQLite and Firebird) do not have catalogs and schemes that can be selected for comparison. In this case (and only for these databases), it is possible to compare the entire datasource entirely.
Databases supporting schema comparison
- SAP HANA
Using schema compare with Liquibase PRO key.
If you have a Liquibase PRO key, then you can use it with DBeaver. Steps you need:
- Find and open your dbeaver.ini file. It is located in the DBeaver root directory.
- Find -vmargs command
- Add a new line after this command: -Dliquibase.license.key=yourKey (example: -Dliquibase.license.key=ABwwGgQU...)
- Open DBeaver and "Schema compare" window. The key will be checked at this step.
You can also add the Liquibase Pro key via UI in Preferences->Editors->Schema Compare preference page.
Import Liquibase Pro Key button to open the Import key dialog.
You can add your key in the Liquibase Key text field manually, throw the
Paste button, or use the
Load button to download a file.
You can check the license state with the
Check Key State button. After pressing the button, you can see the result of the checking in the
We advise you to restart the program after adding a key for correct program work. Settings сhanges will not be applied to the comparison wizard if it is already open in another window. The key will be saved in the DBeaver settings. If you specified the key in the .ini file and installed another key through the Import Key dialog, then the key from the .ini file will be in priority.
If the license key is valid, the
Object types dialog will be extended on PRO objects.
(If PRO objects didn't appear in the schema compare changelog - check your logs. Maybe license expired or key is invalid)
Object types being compared by LiquibasePRO
- Check Constraints
- Synonyms (Oracle)
- Package with the body (Oracle)