4 ms·
I'm new to ClickHouse. Why is this necessary? Isn't there a native way to do ClickHouse migrations?
by christiangenco 2y ago
I'm new to ClickHouse. Why is this necessary? Isn't there a native way to do ClickHouse migrations?
- benpacker 2y agoYou can connect and run SQL, but there’s no built in support for versioning, testing, and rolling back DDL.
- owenthejumper 2y agoMigrations is a confusing word in the context. It's a modern word for 'configuration management for database schemas'.
- vortex_ape 2y agoYou can run DDL commands directly on ClickHouse, but after you have a lot of these commands in your codebase, it becomes a pain to manage them. We had these commands defined in a lot of ruby files named <timestamp>_create_table.rb using which we mimicked the way rails and active record manage the app database migrations. Rails and active record also give you a schema.rb which shows the latest state of the app database at all times. After having no schema.rb for a long time, and it becoming a pain to manage the standalone migration files in ruby, we decided to build this to be able to manage migrations for ClickHouse, our analytics database. We love using it and the schema.sql file (with the latest db state) it generates at the end.