llms.txt: machine-readable documentation index. Markdown version of this page is also available.

IntelliJ IDEA 2026.3 Help

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

Add Liquibase to an existing project

  1. Open the build file in the editor (pom.xml or build.gradle depending on the build tool used in your project).

  2. 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")
  3. (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.

  4. 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.

  1. Open the Persistence tool window.

  2. In the tool window, right-click a persistence unit, mapping context, or entity, and select Plus icon New | Database icon with a blue plus Liquibase Init Changelog.

  3. In the Init Schema Changelog dialog that opens, select which data model the migration should be based on:

    Liquibase Init Schema Migration dialog

    Based on your selection, IntelliJ IDEA automatically fills in the persistence unit, mapping context, or database connection, which you can change if needed.

  4. Click OK.

  5. In the Changelog Preview dialog that opens, configure the changelog and click Save.

Generate a diff changelog

  1. Make sure IntelliJ IDEA is connected to your database.

  2. Open the Database tool window, right-click a database or table, and select Database icon with two blue arrows Create Liquibase Changelog….

    • Alternatively, open the Persistence tool window, right-click a persistence unit, mapping context, or entity, and select Plus icon New | Database icon with two blue arrows Liquibase Changelog….

  3. 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:

    • Target (URL) (previous data model):

    Diff Database Changelog dialog

    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.

  4. Click OK.

  5. 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).

  1. Open the Project tool window (Alt+1).

  2. Right-click the folder with your changelogs and select New | New changelog icon Liquibase Empty Changelog.

    • Alternatively, select the folder, press Alt+Insert, and select New changelog icon Liquibase Empty Changelog.

  3. 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.

Changelog Preview dialog with generated changesets on the left and changelog save options on the right

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 icon

Add Changelog

Create an additional changelog.

Add Changeset

Add Changeset

Create an additional changeset in the selected changelog.

Remove icon

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 icon

Restore from Ignored

Move the selected changesets or changes from the Ignored section to a changelog of your choice.

Move icon

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 icon

Set Context

Set a context for the selected changesets.

Set label icon

Set Label

Set labels for the selected changesets.

Gearwheel icon

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 include tag to the existing changelog, for example:

<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 includeAll tag to the existing changelog, for example:

<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 context attribute to the include or includeAll tag in the existing changelog, for example:

<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

Navigate between changelogs, entities, and the Database tool window

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.

Structure tool window with the Logical tab listing the changes and included changelogs of a Liquibase changelog

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.

  1. Open your root changelog file in the editor.

  2. In the gutter, click Run Liquibase Update….

    Location of the Run Liquibase Update icon in the gutter

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)

  1. Open the configuration file in the editor.

  2. In the gutter, click Green triangle pointing to the right icon 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).

Liquibase icons in the Project tool window with a checkmark for applied migration, exclamation mark for a failed migration

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

Green checkmark icon

All changesets in the changelog were successfully applied to the database.

Red exclamation mark icon

The changelog was run, but one of its changesets failed.

You can find out more about the error by hovering over the file name.

Error details displayed in the Project tool window after hovering the mouse over an underlined changelog

To check which changeset caused the error, open the underlined changelog in the editor and look for a red exclamation mark in the gutter.

Red exclamation mark in the editor gutter next to a changeset

You can click the gutter icon to view the error details again.

(None)

Status icons are not displayed in the following cases:

  • The changelog has not been run yet.

  • The changelog was run before, but one of its changesets failed.

Statuses of particular changesets are displayed in the editor gutter when you open a changelog file.

Status icons in the editor gutter of an opened 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

  1. Open the Run/Debug Configurations dialog:

    • In the main toolbar, click the run widget and select Edit Configurations….

    • Alternatively, go to Run | Edit Configurations….

  2. On the left side of the dialog, select Add New Configuration | Liquibase.

  3. Set up the run configuration options.

Liquibase 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 Tools | Database Versioning | Liquibase.

Open in the IDE

Liquibase plugin settings in the Settings dialog

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 author attribute in generated changesets.

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:

  • XML

  • YAML

  • JSON

  • SQL

Add empty rollback to changesets which don't support implicit one

Automatically add an empty rollback tag to any changeset whose change type does not support automatic rollbacks.

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 number

    • step: value to increase each number by

    • decimalFormat: DecimalFormat pattern used to format the number

  • #date(<simpleDateFormat>): current system 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:

<property name="string.type" value="varchar" dbms="postgresql"/> <property name="string.type" value="nvarchar" dbms="mssql"/> <changeSet id="1622118750064-2" author="admin"> <createTable tableName="owners"> <column name="first_name" type="${string.type}(255)"/> <column name="last_name" type="${string.type}(255)"/> </createTable> </changeSet>

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

failOnError

Select what Liquibase should do if it encounters an error while executing the changeset:

  • If you select this option, Liquibase stops the update process.

  • If you clear this option, Liquibase suppresses the error and executes subsequent changesets.

runOnChange

Select what Liquibase should do if it detects that an already executed changeset has been modified:

  • If you select this option, Liquibase reruns the changeset.

  • If you clear this option, Liquibase throws an exception and stops the update process.

Create Preconditions

Automatically add relevant preconditions to the changeset and select what Liquibase should do if they are not met:

  • HALT: stop the update process.

  • CONTINUE: skip the changeset and execute subsequent changesets. On the next update, try to execute the skipped changeset again.

  • MARK_RAN: skip the changeset, mark it as executed, and execute subsequent changesets.

  • WARN: log a warning and execute the changeset regardless.

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 (View | Tool Windows | JPA Buddy icon JPA Designer) lets you add changes to the currently opened changelog and edit the attributes of its elements.

JPA Designer tool window with Liquibase change types in the upper part and the attributes of a changeset in the lower part

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 Plus icon All New Actions icon in the toolbar lets you perform the following actions related to Liquibase:

The Window with a small panel icon 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.

Editor toolbar of an XML changelog with the Add Liquibase Change menu open on the Drop category
Run icon

Liquibase Update

Deploy changes to the database.

Plus icon

Add Liquibase Change

Add a change to the changelog.

Database icon with a blue plus

Generate Liquibase Init Schema

Generate an init changelog.

Database icon with two blue arrows

Generate Liquibase Diff Changes

Generate a diff changelog.

Gearwheel icon

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-log points to your root changelog file.

    • spring.liquibase.url or spring.datasource.url matches 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-log points to your root changelog file.

    • spring.liquibase.url or spring.datasource.url matches the URL you used to connect to the database.

    • spring.liquibase.default-schema matches 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:

    • changeLogFile points to your root changelog file.

    • url matches the URL you used to connect to the database.

Changelogs are displayed without status icons

Make sure that:

02 December 2026