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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for py-clickhouse-migrator-0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 343ce5e636e9118f9ffcc97262dcc560c709251b6698a0966628ac3130a0ef07 |
|
MD5 | dbad697566a9e8c6ac7659dc54d38829 |
|
BLAKE2b-256 | a9f0d7b5b3867a45b3b4ce6e81ae8c18cf3c9e94c883e72ea2b04bc476717786 |
Close
Hashes for py_clickhouse_migrator-0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1901bd5d51f179305485476f1f23cab922834a30424ed8529ff58da20b3aebf4 |
|
MD5 | bb45c7a3c778e75539a68c1680ca14a4 |
|
BLAKE2b-256 | 33a1ca0316e51a8b00802d78b35c7ddebad2d6e85f62e8a5625d1ec0d8c47898 |