From c77af7c319e0cc011f652d75ac9acf50c28e203c Mon Sep 17 00:00:00 2001 From: Sarah Date: Mon, 18 Mar 2024 17:41:13 -0400 Subject: [PATCH] Update the release tool and add IF NOT EXISTS --- .../V165__add_domain_repo_id_indexes_to_more_tables.sql | 4 ++-- release/schema-deployer/deploy_sql_schema.sh | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/db/src/main/resources/sql/flyway/V165__add_domain_repo_id_indexes_to_more_tables.sql b/db/src/main/resources/sql/flyway/V165__add_domain_repo_id_indexes_to_more_tables.sql index b9751d234..410b1584b 100644 --- a/db/src/main/resources/sql/flyway/V165__add_domain_repo_id_indexes_to_more_tables.sql +++ b/db/src/main/resources/sql/flyway/V165__add_domain_repo_id_indexes_to_more_tables.sql @@ -12,5 +12,5 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -CREATE INDEX CONCURRENTLY IDX69qun5kxt3eux5igrxrqcycv0 ON "DomainHistoryHost" (domain_history_domain_repo_id); -CREATE INDEX CONCURRENTLY IDXf2q9dqj899h1q8lah5y719nxd ON "PollMessage" (domain_repo_id); +CREATE INDEX CONCURRENTLY IF NOT EXISTS IDX69qun5kxt3eux5igrxrqcycv0 ON "DomainHistoryHost" (domain_history_domain_repo_id); +CREATE INDEX CONCURRENTLY IF NOT EXISTS IDXf2q9dqj899h1q8lah5y719nxd ON "PollMessage" (domain_repo_id); diff --git a/release/schema-deployer/deploy_sql_schema.sh b/release/schema-deployer/deploy_sql_schema.sh index 898acea2d..5083c10d1 100755 --- a/release/schema-deployer/deploy_sql_schema.sh +++ b/release/schema-deployer/deploy_sql_schema.sh @@ -78,6 +78,9 @@ if ! pgrep cloud_sql_proxy; then exit 1 fi +# Set the transactional lock to false, session-level lock will be used instead +/flyway/flyway -postgresql.transactional.lock=false info + /flyway/flyway -community -user=${db_user} -password=${db_password} \ -url=jdbc:postgresql://localhost:5432/postgres \ -locations=classpath:sql/flyway \