From f6114458593942c60120d87c3683ea2acffa61e4 Mon Sep 17 00:00:00 2001 From: Fiete <41323592+FieteO@users.noreply.github.com> Date: Mon, 18 Mar 2024 10:15:00 +0000 Subject: [PATCH] Improve idempotency of db creation scripts (#1479) * make sure all CREATE operations in the cassandra db creation scripts use IF NOT EXISTS * make sure all CREATE operations in the atlas db creation scripts use IF NOT EXISTS --- .../main/resources/db/astra/003_concurrent_repairs_part2.cql | 2 +- .../main/resources/db/astra/004_percent_repaired_schedule.cql | 2 +- .../resources/db/cassandra/027_concurrent_repairs_part2.cql | 2 +- .../resources/db/cassandra/028_percent_repaired_schedule.cql | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/src/main/resources/db/astra/003_concurrent_repairs_part2.cql b/src/server/src/main/resources/db/astra/003_concurrent_repairs_part2.cql index bc6962751..d24fce6c8 100644 --- a/src/server/src/main/resources/db/astra/003_concurrent_repairs_part2.cql +++ b/src/server/src/main/resources/db/astra/003_concurrent_repairs_part2.cql @@ -15,7 +15,7 @@ -- -- Add a table to control the number of concurrent repairs -CREATE TABLE running_repairs( +CREATE TABLE IF NOT EXISTS running_repairs( repair_id uuid, node text, reaper_instance_host text, diff --git a/src/server/src/main/resources/db/astra/004_percent_repaired_schedule.cql b/src/server/src/main/resources/db/astra/004_percent_repaired_schedule.cql index 4e56c0110..258234b73 100644 --- a/src/server/src/main/resources/db/astra/004_percent_repaired_schedule.cql +++ b/src/server/src/main/resources/db/astra/004_percent_repaired_schedule.cql @@ -15,7 +15,7 @@ -- -- Add a table to store the percent repaired metrics for incremental repair schedules -CREATE TABLE percent_repaired_by_schedule( +CREATE TABLE IF NOT EXISTS percent_repaired_by_schedule( cluster_name text, repair_schedule_id uuid, time_bucket text, diff --git a/src/server/src/main/resources/db/cassandra/027_concurrent_repairs_part2.cql b/src/server/src/main/resources/db/cassandra/027_concurrent_repairs_part2.cql index 92d1fa842..de934b7b8 100644 --- a/src/server/src/main/resources/db/cassandra/027_concurrent_repairs_part2.cql +++ b/src/server/src/main/resources/db/cassandra/027_concurrent_repairs_part2.cql @@ -15,7 +15,7 @@ -- -- Add a table to control the number of concurrent repairs -CREATE TABLE running_repairs( +CREATE TABLE IF NOT EXISTS running_repairs( repair_id uuid, node text, reaper_instance_host text, diff --git a/src/server/src/main/resources/db/cassandra/028_percent_repaired_schedule.cql b/src/server/src/main/resources/db/cassandra/028_percent_repaired_schedule.cql index b97c0155a..ecc58ec30 100644 --- a/src/server/src/main/resources/db/cassandra/028_percent_repaired_schedule.cql +++ b/src/server/src/main/resources/db/cassandra/028_percent_repaired_schedule.cql @@ -15,7 +15,7 @@ -- -- Add a table to store the percent repaired metrics for incremental repair schedules -CREATE TABLE percent_repaired_by_schedule( +CREATE TABLE IF NOT EXISTS percent_repaired_by_schedule( cluster_name text, repair_schedule_id uuid, time_bucket text,