From 2500dc3ac72851ccdb7dccd743ea9a9da732b88f Mon Sep 17 00:00:00 2001 From: Dom Dwyer Date: Fri, 18 Feb 2022 15:13:15 +0000 Subject: [PATCH 1/2] fix: add public to schema search path The _sql_migrations table cannot be created by the `catalog setup` bootstrap command because it is created before the migrations run, one of which creates the iox_catalog namespace the catalog operates in. This change allows the _sql_migrations table to be created in the public schema to start the migration process, with everything else living in the iox_catalog schema. --- iox_catalog/src/postgres.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iox_catalog/src/postgres.rs b/iox_catalog/src/postgres.rs index ae0589f3a1..049f0b59d3 100644 --- a/iox_catalog/src/postgres.rs +++ b/iox_catalog/src/postgres.rs @@ -253,7 +253,7 @@ async fn new_raw_pool( .execute(&mut *c) .await?; } - let search_path_query = format!("SET search_path TO {}", schema_name); + let search_path_query = format!("SET search_path TO {},public", schema_name); c.execute(sqlx::query(&search_path_query)).await?; Ok(()) }) From 4f0bd29a5be46b8d96b2efcc04af37c22896e97e Mon Sep 17 00:00:00 2001 From: Dom Dwyer Date: Fri, 18 Feb 2022 16:04:38 +0000 Subject: [PATCH 2/2] build: run "catalog setup" in CI Ensures the "catalog setup" command executes successfully by executing it in CI. --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 577a476800..5f0a141d31 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -237,6 +237,7 @@ jobs: - cache_restore - run: cargo install sqlx-cli - run: sqlx database create + - run: INFLUXDB_IOX_CATALOG_DSN=${DATABASE_URL} cargo run -- catalog setup - run: name: Cargo test command: cargo test --workspace --features=aws,azure,azure_test