Skip to content

GoodforGod/liquibase-clickhouse

Repository files navigation

Liquibase Clickhouse

Minimum required Java version Maven Central GitHub Action Coverage Maintainability Rating Lines of Code

Liquibase ClickHouse module for migration.

Supported operations:

  • update
  • rollback (with provided SQL script)
  • tag

Dependency 🚀

Gradle

implementation "io.goodforgod:liquibase-clickhouse:0.8.0"

Maven

<dependency>
    <groupId>io.goodforgod</groupId>
    <artifactId>liquibase-clickhouse</artifactId>
    <version>0.8.0</version>
</dependency>

Liquibase

Supported Liquibase version 4.29.0+

Driver

Supported driver version 0.7.0+

implementation "com.clickhouse:clickhouse-jdbc:0.7.0"
implementation("com.clickhouse:clickhouse-http-client") { version { strictly "0.7.0" } }

Cluster

The cluster mode can be activated by adding the liquibaseClickhouse.conf file to the classpath (liquibase/lib/).

cluster {
    clusterName="{cluster}"
    tableZooKeeperPathPrefix="/clickhouse/tables/{shard}/{database}/"
    tableReplicaName="{replica}"
}

In this mode, liquibase will create its own tables as replicated. All changes in these files will be replicated on the entire cluster. Your updates should also affect the entire cluster either by using ON CLUSTER clause, or by using replicated tables.

License

Based on MEDIARITHMICS/liquibase-clickhouse

This project licensed under the Apache License 2.0 - see the LICENSE file for details.