Skip to main content

Simple tool for manage ClickHouse migrations.

Project description

PyClickHouseMigrate

PyClickHouseMigrate is simple tool for manage your ClickHouse migrations.

Inspired by dbmate and aerich.

Install

 pip install py-clickhouse-migrator

Usage

Init migrations directory.

By default migrator will create and use ./db/migrations.

 migrator --url=clickhouse://default@127.0.0.1:9000/default init

As you can see ClickHouse url passed with --url param.

If you want to change migrations path then you can use --path parameter.

 migrator --path=./your_path/migrations  --url=clickhouse://default@127.0.0.1:9000/default init

After initializitaion make sure you the folders will created.

 tree db

db
├── migrations
└── schema.sql

Create new migration

For creation new migrations you need new command.

  migrator --url=...  new first_migration

Migration ./db/migrations/202401080000_first_migration.py has been created.

And after this you can find empty migration inside db directory:

 tree db
db
├── migrations
│   └── 202401080000_first_migration.py
└── schema.sql

Apply new migration

...

Rollback

...

Show command

...

Actual schema of database

...

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py-clickhouse-migrator-0.3.tar.gz (5.4 MB view hashes)

Uploaded Source

Built Distribution

py_clickhouse_migrator-0.3-py3-none-any.whl (6.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page