Clickhouse is known for its scale to store and fetch large datasets.
Development and Maintenance of large-scale db systems many times requires constant changes to the actual DB system. Holding off the scripts to migrate these will be painful.
This is a python library, which you can execute as a pre-hook using sys python. Or as a migration framework before deployment/server-startup in your application as required.
You can install from pypi using
pip install clickhouse-migrator.
migrate(db_name, migrations_home, db_host, db_user, db_password, create_db_if_no_exists)
|db_name||Clickhouse database name||None|
|migrations_home||Path to list of migration files||<project_root>|
|db_host||Clickhouse database hostname||localhost|
Folder and Migration file patterns
The filenames are pretty similar to how
flyway keeps it.
Your first version filename should be prefixed with
V1__ (double underscore) These migrations are executed one by one, failures in between will stop and not further version files will be executed.