• Stars
    star
    270
  • Rank 152,189 (Top 3 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created over 13 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Liquibase Hibernate Integration

Liquibase Hibernate Integration Build and Test Extension

This is a Liquibase extension for connecting to Hibernate. The extension lets you use your Hibernate configuration as a comparison database for diff, diffChangeLog, and generateChangeLog in Liquibase.

Configuring the extension

These instructions will help you get the extension up and running on your local machine for development and testing purposes. This extension has a prerequisite of Liquibase core in order to use it. Liquibase core can be found at https://www.liquibase.org/download.

Compatiblity

The Liquibase Hibernate extension requires Liquibase 4.x and Java 1.8+. Use liquibase-hibernate5.jar or liquibase-hibernate6.jar depending on your Hibernate version. Ideally the extension version should be the same one as Liquibase version.

This extension can be used with any method of running Liquibase (Command line, Gradle, Maven, Ant, and others.)

Liquibase CLI

Download the latest released Liquibase extension .jar file and place it in the liquibase/lib install directory. If you want to use another location, specify the extension .jar file in the classpath of your liquibase.properties file.

Maven

This extension is available in the maven repository under group org.liquibase.ext, artifacts:

  • liquibase-hibernate6 Hibernate 6.0+ support
  • liquibase-hibernate5 Hibernate 5.0+ support

Specify the Liquibase extension in the <dependency> section of your POM file by adding the org.liquibase.ext dependency for the Liquibase plugin.

<plugin>
     <!--start with basic information to get Liquibase plugin:
     include <groupId>, <artifactID>, and <version> elements-->
     <groupId>org.liquibase</groupId>
     <artifactId>liquibase-maven-plugin</artifactId>
     <version>4.19.0</version>
     <configuration>
        <!--set values for Liquibase properties and settings
        for example, the location of a properties file to use-->
        <propertyFile>liquibase.properties</propertyFile>
     </configuration>
     <dependencies>
     <!--set up any dependencies for Liquibase to function in your
     environment for example, a database-specific plugin-->
            <dependency>
                 <groupId>org.liquibase.ext</groupId>
                 <artifactId>liquibase-hibernate</artifactId>
                 <version>${liquibase-hibernate.version}</version>
            </dependency>
         </dependencies>
      </plugin>

Contribution

To file a bug, improve documentation, or contribute code, follow our guidelines for contributing.

This step-by-step instructions will help you contribute code for the extension.

Once you have created a PR for this extension you can find the artifact for your build using the following link: https://github.com/liquibase/liquibase-hibernate/actions/workflows/build.yml.

Hibernate 5 vs. Hibernate 6

The master branch is Hibernate 6+ compatible. The hibernate5 branch is Hibernate 5.6+ compatible.

Ideally changes should go into the hibernate5 branch and then be merged into master in order to support Hibernate 5 and 6.

Documentation

Using Liquibase with Hibernate

More Information

For more information, see the project wiki.

Issue Tracking

Any issues can be logged in the Github issue tracker.

License

This project is licensed under the Apache License Version 2.0.

Using Liquibase Test Harness' Diff test

Liquibase's Hibernate extension uses Liquibase Test Harness for integration testing.

The HibernateDiffCommandTest class extends the DiffCommandTest class from Test Harness and utilizes the ability to check differences between two databases. As Hibernate is not a Relational database, this is our method of checking that database objects generated/updated by the Liquibase Hibernate extension against a database have the correct attributes.

In general the DiffCommandTest works by utilizing the Liquibase diff command to check differences between two databases, then it creates a changelog file based on diff, then it applies these changes to the target database and checks the diff again. There still could be some differences afterwards as different DBs support different features, so while checking diffs again the test will ignore diffs that are expected.

Configurations for this test are hosted in 2 files:

  • src/test/resources/harness-config.yml -- this is a general config file for Test Harness where DB connection details are specified.
  • src/test/resources/liquibase/harness/diff/diffDatabases.yml -- this file specifies which DBs should be compared and what the diffs are expected even after we try to bring the target DB to same state as the reference DB.

The DiffCommandTest will take all pairs of targetDB-referenceDB from diffDatabases.yml . The test also takes the *.cfg.xml configuration files into consideration. And then the paths to these config files work as the DB connection URLs in the harness-config.yml file.

More Repositories

1

liquibase

Main Liquibase Source
Java
4,597
star
2

liquigraph

Migrations for Neo4j
Java
123
star
3

docker

Dockerfile
61
star
4

liquibase-neo4j

Neo4j extension for Liquibase
Groovy
50
star
5

liquibase-cassandra

Liquibase extension for Cassandra Support
Java
49
star
6

liquibase-oracle

Liquibase extension to add improved Oracle support
Java
47
star
7

liquibase-percona

Liquibase Percona Extension
Java
39
star
8

liquibase-postgresql

Liquibase Postgres Extension
Java
29
star
9

liquibase-github-action

Official Github Action to run Liquibase in your pipeline.
Shell
29
star
10

liquibase-data

Kotlin
26
star
11

liquibase-databricks

Java
25
star
12

liquibase-bigquery

Java
21
star
13

liquibase-redshift

Liquibase support for Redshift
Java
18
star
14

liquibase-mssql

MS SQL Server specific extension
Java
16
star
15

liquibase-couchbase

Liquibase support for Couchbase
Java
14
star
16

liquibase-test-harness

This is a Harness of Integration Tests designed to validate Liquibase behavior
Groovy
14
star
17

liquibase-toolbox

Shell
14
star
18

liquibase-package-manager

lpm - Liquibase package manager
Go
12
star
19

liquibase-github-action-example

Example of how to use the Liquibase Github Action in your CI Pipeline
JavaScript
11
star
20

liquibase-db2i

Liquibase DB2 for iSeries support
Java
11
star
21

liquibase-nochangeloglock

Disables locking logic Liquibase uses to ensure only one instance is running against a database at one time. Not recommended in general but helpful at times
Java
11
star
22

liquibase-hanadb-backup

Liquibase extension for SAP Hana
Java
11
star
23

liquibase-docs

HTML
8
star
24

liquibase-hanadb

Liquibase extension for HANA
Java
7
star
25

liquibase-nochangelogupdate

Liquibase extension to suppress marking changeSets as ran in the DatabaseChangeLog table
Java
6
star
26

liquipy

Python wrapper around Liquibase, sans XML.
Python
6
star
27

prism-liquibase

Extension to PrismJS to provide Liquibase syntax highlighting
TypeScript
6
star
28

liquibase-teradata

Liquibase extension to add Teradata Database support
Java
6
star
29

liquibase-sqlfire

Liquibase support for VMware vFabric SQLFire
Java
5
star
30

liquibase-travisci-example

Example of how to use the Liquibase docker image in your Travis CI Pipeline
5
star
31

liquibase-modify-column

Liquibase "modifyColumn" extension
Java
5
star
32

grails-liquibase

Source for Liquibase Grails Plugin
Groovy
5
star
33

liquibase-javalogger

Liquibase extension to send log messages through java.util.Logger
Java
5
star
34

build-logic

Contains shared build logic for various repositories.
Shell
4
star
35

aws

Collection of Helpful AWS HOWTOS
PLpgSQL
4
star
36

liquibase-extension-example

Example repository for creating your own Liquibase extensions
Java
4
star
37

liquibase-dbmarlin

Liquibase and DBmarlin == Peanut Butter and Chocolate
Java
3
star
38

liquibase-contribute-site

Java
3
star
39

liquibase-filechangelog

Liquibase extension to use a local file to track changes rather than a table
Java
3
star
40

presentations

PLpgSQL
3
star
41

liquibase-cache

Cache database support
Java
3
star
42

custom_qualitychecks

Custom quality checks using regex
3
star
43

liquibase-maxdb

MaxDB database support
Java
3
star
44

SalesManager_App

HTML
3
star
45

manifesto

The values which guide the Liquibase organization, culture, and remote work.
2
star
46

liquibase-sequencetable

Create tables for sequences in databases that do not support sequences
Java
2
star
47

DBDiff

2
star
48

liquibase-harperdb

Liquibase Extension for HarperDB
Java
2
star
49

liquibase4

(Possibly) Temporary repository for Liquibase 4 work
Java
2
star
50

liquibase-yugabytedb

Liquibase support for yugabytedb
Java
2
star
51

liquibase-convert

Utilities for converting things with Liquibase
2
star
52

protobuf-generator

Liquibase Extension that will generate a protobuf file for Liquibase Commands.
Java
2
star
53

ff4j-extension

Liquibase extension to allow use of FF4J feature flags in changelogs and changesets
Java
2
star
54

liquibase-spinnaker-plugin

Spinnaker plugin for configuring and running Liquibase jobs
Kotlin
2
star
55

liquibase-parent-pom

Parent pom for all the extensions to consume
Java
2
star
56

liquibase-jenkinsfiles

Groovy
1
star
57

liquibase-aerospike

Java
1
star
58

liquibase-git-resource

Java
1
star
59

liquibase-dynamodb

Liquibase extension for DynamoDB
Java
1
star
60

flipt-extension

Liquibase extension to allow use of Flipt feature flags in changelogs and changesets
Java
1
star
61

liquibase-jenkins

Java
1
star
62

liquibase-compat

Helps extensions written for Liquibase 3.x to work with Liquibase 4.0+
Java
1
star
63

LBP_DEMO

Demo changelog configurations
1
star
64

better-botz-gui-at-glitch

A Better Botz user interface built on Glitch using Node.js, on Express, with DataStax Apollo as the highly available backing store!
JavaScript
1
star
65

liquibase-amazon-keyspaces

Java
1
star
66

github-action-generator

Main repository to generate GitHub Actions for liquibase-github-actions
Go
1
star
67

liquibase-sdk-maven-plugin

Support tools for Liquibase development (Maven based)
Java
1
star
68

liquibase-opensearch

Liquibase Opensearch Community Extension
Java
1
star
69

liquibase-mysql

1
star
70

flagr-extension

Liquibase extension to allow use of Flagr feature flags in changelogs and changesets
Java
1
star
71

custom-hosts-extension

Java
1
star
72

Observability-Dashboards

1
star