Software & Apps
Database Migrations for ClickHouse — houseplant 0.2.2 documentation
Houseplant is a CLI tool that helps you manage database migrations for ClickHouse.
Here’s how you can manage your migration to ClickHouse:
$ houseplant init
✨ Project initialized successfully!
$ houseplant generate "add events"
✨ Generated migration: ch/migrations/20240101000000_add_events.yml
$ houseplant migrate:status
Database: june_development
┏━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┓
┃ Status ┃ Migration ID ┃ Migration Name ┃
┡━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━┩
│ up │ 20240101000000 │ add events │
└────────┴────────────────┴────────────────┘
$ houseplant migrate
✓ Applied migration 20241121003230_add_events.yml
$ houseplant migrate:up VERSION=20241121003230
✓ Applied migration 20241121003230_add_events.yml
$ houseplant migrate:down VERSION=20241121003230
✓ Rolled back migration 20241121003230_add_events.yml
Why Houseplant?
-
Schema Management: Houseplant automatically tracks and manages your changes to the ClickHouse schema, making it easy to evolve your data model over time
-
Developer Experience: Write migrations in YAML format, so they are easy to read, review, and maintain
-
Supporting the Environment: Separate configurations for development, test, and production environments
-
Rich CLI: Includes an intuitive command-line interface for all migration operations
The User’s Guide
2024-12-27 18:11:00