Liquibase
Liquibase is a database migration tool that lets you version, track, and apply database changes. IntelliJ IDEA provides a dedicated plugin for Liquibase that lets you perform the following tasks:
Generate changelogs.
View the changelog structure in the Structure tool window.
Navigate between changelogs, entity classes, and the Database tool window.
Deploy changes to the database with a dedicated run configuration.
Customize changelog file names and changeset attributes.
The plugin also provides coding assistance for changelogs and Liquibase configuration files.
Prerequisites
The following plugins are enabled:
Liquibase (bundled)
Database Tools and SQL (bundled)
Jakarta EE: Persistence (JPA) (bundled): required for generating changelogs from entity mappings
YAML (bundled): required for working with YAML changelogs
To check if the plugins are enabled, open Settings (Ctrl+Alt+S) and go to Plugins.
Your build file (pom.xml or build.gradle) includes the
liquibase-coredependency.The Database tool window lists at least one data source.
Add Liquibase to an existing project
Open the build file in the editor (pom.xml or build.gradle depending on the build tool used in your project).
Add the Liquibase library, and make sure its version matches the rest of your project:
<dependency> <groupId>org.liquibase</groupId> <artifactId>liquibase-core</artifactId> <version>4.32.0</version> </dependency>implementation 'org.liquibase:liquibase-core:4.32.0'implementation("org.liquibase:liquibase-core:4.32.0")(Optional) If you want to run Liquibase commands using Maven or Gradle, add the dedicated plugin:
<plugin> <groupId>org.liquibase</groupId> <artifactId>liquibase-maven-plugin</artifactId> <version>5.0.4</version> <configuration> <url>${YOUR_DATABASE_URL}</url> <username>${YOUR_DATABASE_USERNAME}</username> <password>${YOUR_DATABASE_PASSWORD}</password> </configuration> </plugin>For more information about configuring the plugin, refer to the official Liquibase documentation.
buildscript { repositories { mavenCentral() } dependencies { classpath 'org.liquibase:liquibase-core:5.0.4' } } plugins { id 'org.liquibase.gradle' version '3.1.0' } dependencies { liquibaseRuntime 'org.liquibase:liquibase-core:5.0.4' liquibaseRuntime 'org.liquibase:liquibase-groovy-dsl:4.0.1' liquibaseRuntime 'info.picocli:picocli:4.7.7' liquibaseRuntime '<DATABASE DRIVER>' } liquibase { activities { main { changelogFile 'src/main/resources/db/changelog/db.changelog-master.xml' url '<YOUR DATABASE URL>' username '<YOUR DATABASE USERNAME>' password '<YOUR DATABASE PASSWORD>' } } }For more information about configuring the plugin, refer to the Liquibase Gradle Plugin repository on GitHub.
buildscript { repositories { mavenCentral() } dependencies { classpath("org.liquibase:liquibase-core:5.0.4") } } plugins { id("org.liquibase.gradle") version "3.1.0" } dependencies { liquibaseRuntime("org.liquibase:liquibase-core:5.0.4") liquibaseRuntime("org.liquibase:liquibase-groovy-dsl:4.0.1") liquibaseRuntime("info.picocli:picocli:4.7.7") liquibaseRuntime("<DATABASE DRIVER>") } liquibase { activities.register("main") { arguments = mapOf( "changelogFile" to "src/main/resources/db/changelog/db.changelog-master.xml", "url" to "<YOUR DATABASE URL>", "username" to "<YOUR DATABASE USERNAME>", "password" to "<YOUR DATABASE PASSWORD>" ) } }For more information about configuring the plugin, refer to the Liquibase Gradle Plugin repository on GitHub.
Press Ctrl+Shift+O to import the changes.
For more information about working with build tools, refer to Maven or Gradle.
Liquibase changelogs
Liquibase changelogs define changes to the database schema or data. Liquibase supports changelogs written in XML, YAML, JSON, and SQL.
Generate changelogs
IntelliJ IDEA provides built-in actions for generating the following types of Liquibase migrations:
Init changelog: captures a selected data model (database, persistence unit, or mapping context) in its current form. The result is a changelog file that you can use to recreate that data model in an empty database.
Diff changelog: captures the differences between two data models: for example, between the current database schema and the entity mappings in your code. The result is a changelog file that you can run against the target model to make it match the source.
Empty changelog: creates an XML or YAML changelog from a file template.
Generate an init changelog
With IntelliJ IDEA, you can initialize your database schema based on the mappings provided in your entity classes. It will generate a set of DDL commands for your current entities in the form of a Liquibase changelog.
Open the Persistence tool window.
In the tool window, right-click a persistence unit, mapping context, or entity, and select .
In the Init Schema Changelog dialog that opens, select which data model the migration should be based on:
Model: entity mappings from one of the following:
persistence unit (in JPA and Spring Data JPA projects)
mapping context (in Spring Data JDBC projects)
DB: schema from a connected database

Based on your selection, IntelliJ IDEA automatically fills in the persistence unit, mapping context, or database connection, which you can change if needed.
Click OK.
In the Changelog Preview dialog that opens, configure the changelog and click Save.
Generate a diff changelog
Make sure IntelliJ IDEA is connected to your database.
Open the Database tool window, right-click a database or table, and select
Create Liquibase Changelog….
Alternatively, open the Persistence tool window, right-click a persistence unit, mapping context, or entity, and select .
In the Diff Database Changelog dialog that opens, select which data models to compare:
Source (referenceURL) (current data model):
DB: schema from a connected database
Model: entity mappings from one of the following:
persistence unit (in JPA and Spring Data JPA projects)
mapping context (in Spring Data JDBC projects)
Target (URL) (previous data model):
DB: schema from a connected database
Snapshot: schema from a data model snapshot

If you select DB or Model, IntelliJ IDEA automatically fills in the persistence unit, mapping context, or database connection, which you can change if needed.
Click OK.
In the Changelog Preview dialog that opens, configure the changelog and click Save.
Create an empty changelog
Apart from generating changelogs that are already filled with changes, you can also create an empty changelog and fill it out yourself. An empty changelog uses the Liquibase Changelog file template for the format you select (XML or YAML).
Open the Project tool window (Alt+1).
Right-click the folder with your changelogs and select .
Alternatively, select the folder, press Alt+Insert, and select
Liquibase Empty Changelog.
In the New Liquibase Changelog popup that opens, specify the file name and select the format (XML or YAML).
IntelliJ IDEA creates the changelog from the template and opens it in the editor.
Reference: Changelog Preview dialog
The Changelog Preview dialog lets you review the generated changes, organize them into changelogs and changesets, and configure how to save them.

The left side of the dialog displays a tree of the generated changelogs, changesets, and the changes they contain. Each change is color-coded by its danger level and marked with an icon that represents its type. The right side of the dialog displays the code for the selected tree item and options that let you configure it.
The icons in the toolbar let you manage the generated changes, changesets, and changelogs:
Add Changelog
Create an additional changelog.
Add Changeset
Create an additional changeset in the selected changelog.
Remove from Changelog
Remove the selected changesets or changes from the changelog and, optionally, move them to the Ignored section so they are excluded from future changelogs.
Restore from Ignored
Move the selected changesets or changes from the Ignored section to a changelog of your choice.
Move to Another Changelog
Move the selected changesets or changes to another changelog.
If you select this option when there are no other changelogs in the dialog, IntelliJ IDEA creates one automatically.
Set Context
Set a context for the selected changesets.
Set Label
Set labels for the selected changesets.
Show Other Actions
Interact with multiple changes at once: Select All with a specific danger level, Expand All, or Collapse All.
If you select a changelog in the changes tree, the following options appear on the right side of the dialog:
Item | Description |
|---|---|
Save as | Choose whether to save the changelog as a regular file or a scratch file. |
Directory | Select a location where IntelliJ IDEA should save the file. IntelliJ IDEA fills in the directory automatically based on the Liquibase plugin settings. |
File name | Set the file name. IntelliJ IDEA fills in the file name automatically based on the Liquibase plugin settings. |
Include to | If you want to include the new changelog in an existing one (for example, your root changelog), specify the path to it. This will add an
<databaseChangeLog>
<include file="db/changelog/2026/changelog-001.xml"/>
</databaseChangeLog>
|
Include folder | If you specified a changelog in the Include to field and want to include the whole folder instead of only the new changelog, select this option. This will add an
<databaseChangeLog>
<includeAll path="db/changelog/2026"/>
</databaseChangeLog>
|
Include context | If you want to only include the new changelog only for a particular context, specify it. This will add a
<databaseChangeLog>
<include file="db/changelog/2026/changelog-001.xml" context="dev"/>
</databaseChangeLog>
|
File type | Select the changelog format: XML, YAML, JSON, or SQL. You can only change the format of the first changelog in the list. All other changelogs in the dialog will use the same format. |
If you select a changeset in the changes tree, the following options appear on the right side of the dialog:
Item | Description |
|---|---|
Id | Specify the changeset ID. |
Author | Specify the changeset author. IntelliJ IDEA automatically fills in this value based on the Liquibase plugin settings. |
Context | Specify contexts for the changeset. In case of multiple values, separate them with commas. |
Labels | Specify labels for the changeset. In case of multiple values, separate them with commas. |
Tips for working with changelogs
- Use coding assistance
IntelliJ IDEA provides coding assistance for Liquibase in the following file types:
Changelogs:
Completion for change types and their attributes
Completion for properties
Completion for table, column, and sequence names
Error highlighting
liquibase.properties and Spring Boot configuration files (application.properties or application.yaml):
Completion for property keys, which also displays the descriptions and default values of suggested keys
Quick Documentation for property keys
You can use quick navigation for the following changelog elements:
Table, column, and sequence names: to the entity class where the database object is declared and to its node in the Database tool window
File names: to the referenced file
Property names: to the changelog where the property is declared
To use quick navigation, open the changelog in the editor, place the caret on one of the supported elements, and press Ctrl+B. If prompted, select a destination from the Choose Declaration list.
- View the changelog structure in the Structure tool window
You can view the changes included in your changelogs in the logical view of the Structure tool window (Alt+7). This is useful when you work with large changelogs and want to see what changes they contain without reading every changeset in each file.

Each change in the tree displays the database object it affects, the change type, and the ID of its changeset. Included changelogs appear as separate nodes with their own changes.
To open and highlight a change in the editor, click it in the tool window.
Deploy the changes
Once your changelogs are ready, you can use a dedicated Liquibase run configuration to trigger the update and synchronize your database with your code. You can launch this run configuration from the following places in IntelliJ IDEA:
Run the update from the run widget
If the Liquibase run configuration is already selected in the widget, click
Run.
Alternatively, press Shift+F10.
If another configuration is selected in the widget, click its name. In the popup that opens, find the Liquibase run configuration and click
Run next to it.
Alternatively, press Alt+Shift+F10. In the popup that opens, select the Liquibase run configuration.
IntelliJ IDEA launches the run configuration in the Run tool window.
Run the update from a tool window
You can launch the Liquibase run configuration from the following tool windows:
Persistence tool window:
Right-click anywhere in the tool window and select
Run Liquibase Update….
Database tool window:
Go to the toolbar and select
Run Liquibase Update….
Right-click a database, schema, or table, and select
Run Liquibase Update….
IntelliJ IDEA launches the run configuration in the Run tool window.
Run the update from the root changelog
You can launch the Liquibase run configuration directly from your root changelog file if the spring.liquibase.change-log property in your configuration file points to it.
Open your root changelog file in the editor.
In the gutter, click
Run Liquibase Update….

IntelliJ IDEA launches the run configuration in the Run tool window.
Run the update from the configuration file
You can launch the Liquibase run configuration from the following files:
Liquibase configuration file (liquibase.properties)
Spring Boot configuration file (application.properties or application.yml)
Open the configuration file in the editor.
In the gutter, click
Run Liquibase Update… .
IntelliJ IDEA launches the run configuration in the Run tool window.
Statuses of changelogs and changesets
Typically, if you want to check which changelogs were already applied, you need to either run Liquibase's change tracking commands or inspect its changelog table in your database. IntelliJ IDEA provides a faster alternative by displaying the statuses of your changes directly in the IDE.
Statuses of whole changelog files are displayed in the Project tool window (Alt+1).

Each changelog is represented by the Liquibase logo (), and its status is reflected by a small icon in the logo's lower-right corner:
Icon | Status |
|---|---|
All changesets in the changelog were successfully applied to the database. | |
The changelog was run, but one of its changesets failed. You can find out more about the error by hovering over the file name. ![]() To check which changeset caused the error, open the underlined changelog in the editor and look for a red exclamation mark in the gutter. You can click the gutter icon to view the error details again. | |
(None) | Status icons are not displayed in the following cases:
|
Statuses of particular changesets are displayed in the editor gutter when you open a changelog file.

Liquibase run configuration
The Liquibase run configuration lets you deploy your changes to a connected database without having to run the whole application or use the terminal. Under the hood, this configuration runs the Liquibase update command.
Create a Liquibase run configuration
Open the Run/Debug Configurations dialog:
In the main toolbar, click the run widget and select Edit Configurations….
Alternatively, go to .
On the left side of the dialog, select .
Set up the run configuration options.

Reference: Run configuration options
Item | Description |
|---|---|
Name | Specify a name for the run configuration to quickly identify it among others when editing or running. |
Store as project file | Save the run configuration settings to a file that you can share with other team members. The default location is .idea/runConfigurations. However, if you do not want to share the .idea directory, you can save the configuration to any other directory within the project. By default, this option is disabled, and IntelliJ IDEA stores run configuration settings in .idea/workspace.xml. |
Required options
Item | Description |
|---|---|
Root changelog file | Specify the path to your root changelog file. |
DB connection | Select which database Liquibase should target when running the changelogs. You need to select an existing data source from the Database tool window or create a new one by clicking |
Additional options
To add these options to your run configuration, select Modify options on the right side of the dialog and then select the relevant options from the list.
Item | Description |
|---|---|
Context | Specify context filters to narrow down which changesets Liquibase will run during the update. In case of multiple values, separate them with commas. |
Labels | Specify label filters to narrow down which changesets Liquibase will run during the update. In case of multiple values, separate them with commas. |
Default schema | Specify the schema that Liquibase should manage. Learn more about this setting from Liquibase's official documentation. |
Liquibase schema | Specify the schema where Liquibase should create its tracking tables. Learn more about this setting from Liquibase's official documentation. |
Log level | Select the minimum severity level that should be logged during the update. Learn more about this setting from Liquibase's official documentation. |
Reference: Liquibase plugin settings
The Liquibase plugin settings in IntelliJ IDEA let you customize how the IDE generates changelogs and changesets, such as their format, naming patterns, and default attributes.
To access the Liquibase plugin settings, open Settings (Ctrl+Alt+S) and go to .

The settings are grouped into the following sections:
Base settings
Item | Description |
|---|---|
Liquibase version | Specify which Liquibase version you want to use in the project. If you leave this field empty, the IDE will use the version from your build file. |
Changeset author | Specify the value for the If you leave this field empty, the IDE will use the username from your operating system. |
File type | Select which language to use when generating changelogs:
|
Add empty rollback to changesets which don't support implicit one | Automatically add an empty To learn how to write rollback statements, refer to the official Liquibase documentation. |
Changelog Templates
The Changelog Templates settings let you specify the naming patterns that the IDE should use when generating changelog files and directories. You can include literal values as well as the following macros:
#increment(<start>, <step>, <decimalFormat>): numeric sequence.start: first numberstep: value to increase each number bydecimalFormat: DecimalFormat pattern used to format the number
#date(<simpleDateFormat>): current system date.simpleDateFormat: SimpleDateFormat pattern used to format the date
${semVer.<getterMethod>}: semantic version from the project's build file.getterMethod: method that extracts a specific segment of the semantic version. Here are examples for a 1.2.3-SNAPSHOT+build4 version:${semVer.getRawVersion()}: 1.2.3-SNAPSHOT+build4${semVer.getMajor()}: 1${semVer.getMinor()}: 2${semVer.getPatch()}: 3${semVer.getPreRelease()}: SNAPSHOT
DB Types
The Db Types settings let you select the DBMSes that your changelogs should support. When you generate a changelog from entity mappings, IntelliJ IDEA will replace fixed column types with properties and map the matching column types for each selected DBMS. This will add property tags at the top of the changelogs, for example:
Changeset Templates
The Changeset Templates settings let you preconfigure commonly used changeset attributes for each change type. IntelliJ IDEA will automatically insert them into the relevant changesets every time you generate a changelog.
Item | Description |
|---|---|
Select what Liquibase should do if it encounters an error while executing the changeset:
| |
Select what Liquibase should do if it detects that an already executed changeset has been modified:
| |
Create Preconditions | Automatically add relevant preconditions to the changeset and select what Liquibase should do if they are not met:
|
JPA Buddy integration
If you install the JPA Buddy plugin, you can add and edit changes in Liquibase changelogs from two additional places in IntelliJ IDEA: the JPA Designer tool window and the editor toolbar.
JPA Designer tool window
The JPA Designer tool window () lets you add changes to the currently opened changelog and edit the attributes of its elements.

The upper section of the tool window (palette) lists changes that you can add to the changelog. The lower section (inspector) displays attributes available for the currently selected changelog element (for example, a changeset or a column name). To add a change or edit an attribute, double-click it.
The All New Actions icon in the toolbar lets you perform the following actions related to Liquibase:
Liquibase Empty Changelog: create an empty changelog.
Liquibase Changelog…: generate a diff changelog.
Liquibase Init Changelog…: generate an init changelog.
Data Model Snapshot…: generate a data model snapshot.
The Configure Editor Toolbar and Tool Windows icon in the toolbar lets you customize which sections are displayed in this tool window.
To learn more about the JPA Designer tool window, refer to Entity Designer.
Editor toolbar
The toolbar at the top of the editor lets you add new changes to the currently opened changelog and generate new changelogs.

Liquibase Update
Add Liquibase Change
Add a change to the changelog.
Generate Liquibase Init Schema
Generate Liquibase Diff Changes
Configure Editor Toolbar and Tool Windows
Open the Designer Settings page, where you can hide or display the editor toolbar for Liquibase changelogs.
Troubleshooting
- Cannot run the migration process from the configuration file
Make sure that:
You added the Liquibase dependency to your project's build file.
You connected to the corresponding database, and the connection is active in the Database tool window.
Your configuration file (application.properties or application.yml) meets the following criteria:
spring.liquibase.change-logpoints to your root changelog file.spring.liquibase.urlorspring.datasource.urlmatches the URL you used to connect to the database.
- Changelogs or changesets are displayed without status icons
Make sure that:
You added the Liquibase dependency to your project's build file.
You connected to the corresponding database, and the connection is active in the Database tool window.
Your configuration file (application.properties or application.yml) meets the following criteria:
spring.liquibase.change-logpoints to your root changelog file.spring.liquibase.urlorspring.datasource.urlmatches the URL you used to connect to the database.spring.liquibase.default-schemamatches the database schema you updated.
You already ran a Liquibase update, and its results were recorded in the database changelog table.
- Cannot run the migration process from the configuration file
Make sure that:
You added the Liquibase dependency to your project's build file.
You connected to the corresponding database, and the connection is active in the Database tool window.
Your configuration file (liquibase.properties) meets the following criteria:
changeLogFilepoints to your root changelog file.urlmatches the URL you used to connect to the database.
- Changelogs are displayed without status icons
Make sure that:
You added the Liquibase dependency to your project's build file.
You connected to the corresponding database, and the connection is active in the Database tool window.
Your configuration file (liquibase.properties) meets the following criteria:
changeLogFilepoints to your root changelog file.urlmatches the URL you used to connect to the database.defaultSchemaNamematches the database schema you updated.
You already ran a Liquibase update, and its results were recorded in the database changelog table.

