We're rolling out Flyway across several database targets, including ClickHouse, and want to confirm the intended pattern before we lock in our pipeline design. Our setup uses a ClickHouse operator (K8s) to manage the cluster, but it does not create application-level databases.
A few clarifying questions:
1. Database creation ownership - Does Flyway ever issue CREATE DATABASE itself as part of connecting or migrating, or is it assumed the target database already exists before Flyway's first connection? For Postgres we know Flyway expects an existing database - is ClickHouse the same, or does the plugin handle this differently given ClickHouse's CREATE DATABASE [IF NOT EXISTS] semantics?
2. Recommended bootstrap pattern - If the database doesn't exist yet, what's the Redgate's recommended approach: connect to default and have V1__...sql run CREATE DATABASE IF NOT EXISTS <name>, or is database provisioning expected to happen entirely outside Flyway (Terraform/Helm/init job) before Flyway ever runs?
3. baseline on ClickHouse - Does this behave identically to Postgres/MySQL, or are there ClickHouse-specific caveats we should know about before relying on it in an automated pipeline?
4. Cluster / ON CLUSTER scenarios - If we're targeting a ClickHouse cluster rather than a single node, is there guidance on how the initial CREATE DATABASE (and the schema history table itself) should be created with ON CLUSTER so it replicates correctly, versus creating it only on one node?
Thanks!
We're rolling out Flyway across several database targets, including ClickHouse, and want to confirm the intended pattern before we lock in our pipeline design. Our setup uses a ClickHouse operator (K8s) to manage the cluster, but it does not create application-level databases.
A few clarifying questions:
1. Database creation ownership - Does Flyway ever issue CREATE DATABASE itself as part of connecting or migrating, or is it assumed the target database already exists before Flyway's first connection? For Postgres we know Flyway expects an existing database - is ClickHouse the same, or does the plugin handle this differently given ClickHouse's CREATE DATABASE [IF NOT EXISTS] semantics?
2. Recommended bootstrap pattern - If the database doesn't exist yet, what's the Redgate's recommended approach: connect to default and have V1__...sql run CREATE DATABASE IF NOT EXISTS <name>, or is database provisioning expected to happen entirely outside Flyway (Terraform/Helm/init job) before Flyway ever runs?
3. baseline on ClickHouse - Does this behave identically to Postgres/MySQL, or are there ClickHouse-specific caveats we should know about before relying on it in an automated pipeline?
4. Cluster / ON CLUSTER scenarios - If we're targeting a ClickHouse cluster rather than a single node, is there guidance on how the initial CREATE DATABASE (and the schema history table itself) should be created with ON CLUSTER so it replicates correctly, versus creating it only on one node?
Thanks!