Sign inSign up

barloc/clickhouse-migrations-for-cluster

By barloc

•Updated over 2 years ago

Service applies migrations from the directory to the clickhouse cluster.

Image
Databases & storage
0

175

barloc/clickhouse-migrations-for-cluster repository overview

⁠clickhouse migrations for cluster mode

Service applies migrations from the directory to the clickhouse cluster. Main goal of the service - dev or test environments, which are identical with production environment.

More: https://github.com/barloc/clickhouse-migrations-for-cluster⁠

⁠Important

Clickhouse doesn't have transactions for replicated tables, so we can not provide apllying migration in the single transaction. It is always applying migration queries step by step and after it writing success message to the trunsactions table in the cluster.

⁠Usage

Add your migrations directory to the docker image and then execute it.

docker run -v ... -e ... barloc/clickhouse-migrations-for-cluster:0.0.1

⁠Params

Only via envs.

  • CHMFC_CH_HOST - hostname of the cluster (default: localhost)
  • CHMFC_CH_PORT - port (default: 9000)
  • CHMFC_CH_LOGIN - login (default: test)
  • CHMFC_CH_PASSWORD - password (default: test)
  • CHMFC_CH_DATABASE - database for connection (default: test)
  • CHMFC_MIG_PATH - path to the directory with migrations (default: test-migrations)
  • CHMFC_MIG_TABLE - name of the table with applying migrations (default: test._migrations)
⁠Migrations name (file)
  • Every file with migration must have prefix with number (0001, 01, 010...), it is version of migrations. Migrations applies in the order of this prefix (version).
  • Every file contains one or many query with ; between.

Tag summary

Content type

Image

Digest

sha256:ad7661fe0…

Size

41.9 MB

Last updated

over 2 years ago

docker pull barloc/clickhouse-migrations-for-cluster:0.0.3