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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file py-clickhouse-migrator-0.3.tar.gz.
File metadata
- Download URL: py-clickhouse-migrator-0.3.tar.gz
- Upload date:
- Size: 5.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
343ce5e636e9118f9ffcc97262dcc560c709251b6698a0966628ac3130a0ef07
|
|
| MD5 |
dbad697566a9e8c6ac7659dc54d38829
|
|
| BLAKE2b-256 |
a9f0d7b5b3867a45b3b4ce6e81ae8c18cf3c9e94c883e72ea2b04bc476717786
|
File details
Details for the file py_clickhouse_migrator-0.3-py3-none-any.whl.
File metadata
- Download URL: py_clickhouse_migrator-0.3-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1901bd5d51f179305485476f1f23cab922834a30424ed8529ff58da20b3aebf4
|
|
| MD5 |
bb45c7a3c778e75539a68c1680ca14a4
|
|
| BLAKE2b-256 |
33a1ca0316e51a8b00802d78b35c7ddebad2d6e85f62e8a5625d1ec0d8c47898
|