diff --git a/db/src/main/resources/sql/er_diagram/brief_er_diagram.html b/db/src/main/resources/sql/er_diagram/brief_er_diagram.html
index 0eac7462f..6e0b1159a 100644
--- a/db/src/main/resources/sql/er_diagram/brief_er_diagram.html
+++ b/db/src/main/resources/sql/er_diagram/brief_er_diagram.html
@@ -261,11 +261,11 @@ td.section {
generated on |
- 2022-03-08 17:12:37.970348 |
+ 2022-03-09 22:28:58.465478 |
last flyway file |
- V108__add_host_indexes_for_whois.sql |
+ V112__add_billingrecurrence_missing_indexes.sql |
@@ -284,7 +284,7 @@ td.section {
generated on
- 2022-03-08 17:12:37.970348
+ 2022-03-09 22:28:58.465478
diff --git a/db/src/main/resources/sql/er_diagram/full_er_diagram.html b/db/src/main/resources/sql/er_diagram/full_er_diagram.html
index 67bcc3e4b..a80e2c145 100644
--- a/db/src/main/resources/sql/er_diagram/full_er_diagram.html
+++ b/db/src/main/resources/sql/er_diagram/full_er_diagram.html
@@ -261,11 +261,11 @@ td.section {
generated on |
- 2022-03-08 17:12:35.997985 |
+ 2022-03-09 22:28:56.561494 |
last flyway file |
- V108__add_host_indexes_for_whois.sql |
+ V112__add_billingrecurrence_missing_indexes.sql |
@@ -284,7 +284,7 @@ td.section {
generated on
- 2022-03-08 17:12:35.997985
+ 2022-03-09 22:28:56.561494
diff --git a/db/src/main/resources/sql/flyway.txt b/db/src/main/resources/sql/flyway.txt
index 9659467f5..1ebcbdfd3 100644
--- a/db/src/main/resources/sql/flyway.txt
+++ b/db/src/main/resources/sql/flyway.txt
@@ -103,6 +103,10 @@ V102__add_indexes_to_domain_history_sub_tables.sql
V103__creation_time_not_null.sql
V104__add_transfer_response_host_id_to_poll_message.sql
V105__add_index_on_host_name_in_host_table.sql
-V106__add_missing_indexes_from_query_analyzer.sql
-V107__add_billingevent_domainrepoid_indexes.sql
+V106__add_domain_missing_indexes_from_query_analyzer.sql
+V107__add_billingevent_missing_indexes.sql
V108__add_host_indexes_for_whois.sql
+V109__add_domain_host_missing_indexes_from_query_analyzer.sql
+V110__add_graceperiod_missing_indexes_from_query_analyzer.sql
+V111__add_billingcancellation_missing_indexes.sql
+V112__add_billingrecurrence_missing_indexes.sql
diff --git a/db/src/main/resources/sql/flyway/V106__add_domain_missing_indexes_from_query_analyzer.sql b/db/src/main/resources/sql/flyway/V106__add_domain_missing_indexes_from_query_analyzer.sql
new file mode 100644
index 000000000..b86a47227
--- /dev/null
+++ b/db/src/main/resources/sql/flyway/V106__add_domain_missing_indexes_from_query_analyzer.sql
@@ -0,0 +1,20 @@
+-- Copyright 2022 The Nomulus Authors. All Rights Reserved.
+--
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+
+CREATE INDEX IF NOT EXISTS IDX3y3k7m2bkgahm9sixiohgyrga
+ ON "Domain" (transfer_billing_event_id);
+CREATE INDEX IF NOT EXISTS IDXsfci08jgsymxy6ovh4k7r358c
+ ON "Domain" (billing_recurrence_id);
+CREATE INDEX IF NOT EXISTS IDXcju58vqascbpve1t7fem53ctl
+ ON "Domain" (transfer_billing_recurrence_id);
diff --git a/db/src/main/resources/sql/flyway/V106__add_missing_indexes_from_query_analyzer.sql b/db/src/main/resources/sql/flyway/V106__add_missing_indexes_from_query_analyzer.sql
deleted file mode 100644
index 1d22281da..000000000
--- a/db/src/main/resources/sql/flyway/V106__add_missing_indexes_from_query_analyzer.sql
+++ /dev/null
@@ -1,27 +0,0 @@
--- Copyright 2022 The Nomulus Authors. All Rights Reserved.
---
--- Licensed under the Apache License, Version 2.0 (the "License");
--- you may not use this file except in compliance with the License.
--- You may obtain a copy of the License at
---
--- http://www.apache.org/licenses/LICENSE-2.0
---
--- Unless required by applicable law or agreed to in writing, software
--- distributed under the License is distributed on an "AS IS" BASIS,
--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--- See the License for the specific language governing permissions and
--- limitations under the License.
-
-CREATE INDEX IDX3y3k7m2bkgahm9sixiohgyrga ON "Domain" (transfer_billing_event_id);
-CREATE INDEX IDXsfci08jgsymxy6ovh4k7r358c ON "Domain" (billing_recurrence_id);
-CREATE INDEX IDXcju58vqascbpve1t7fem53ctl ON "Domain" (transfer_billing_recurrence_id);
-
-CREATE INDEX IDXjw3rwtfrexyq53x9vu7qghrdt ON "DomainHost" (host_repo_id);
-
-CREATE INDEX IDXbgssjudpm428mrv0xfpvgifps ON "GracePeriod" (billing_event_id);
-CREATE INDEX IDX5u5m6clpk3nktrvtyy5umacb6 ON "GracePeriod" (billing_recurrence_id);
-
-CREATE INDEX IDX6ebt3nwk5ocvnremnhnlkl6ff ON "BillingEvent" (cancellation_matching_billing_recurrence_id);
-
-CREATE INDEX IDX4ytbe5f3b39trsd4okx5ijhs4 ON "BillingCancellation" (billing_event_id);
-CREATE INDEX IDXku0fopwyvd57ebo8bf0jg9xo2 ON "BillingCancellation" (billing_recurrence_id);
diff --git a/db/src/main/resources/sql/flyway/V107__add_billingevent_missing_indexes.sql b/db/src/main/resources/sql/flyway/V107__add_billingevent_missing_indexes.sql
new file mode 100644
index 000000000..3f10568aa
--- /dev/null
+++ b/db/src/main/resources/sql/flyway/V107__add_billingevent_missing_indexes.sql
@@ -0,0 +1,18 @@
+-- Copyright 2022 The Nomulus Authors. All Rights Reserved.
+--
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed ON an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+
+CREATE INDEX IF NOT EXISTS IDX6ebt3nwk5ocvnremnhnlkl6ff
+ ON "BillingEvent" (cancellation_matching_billing_recurrence_id);
+CREATE INDEX IF NOT EXISTS IDXbgfmveqa7e5hn689koikwn70r
+ ON "BillingEvent" (domain_repo_id);
diff --git a/db/src/main/resources/sql/flyway/V107__add_billingevent_domainrepoid_indexes.sql b/db/src/main/resources/sql/flyway/V109__add_domain_host_missing_indexes_from_query_analyzer.sql
similarity index 71%
rename from db/src/main/resources/sql/flyway/V107__add_billingevent_domainrepoid_indexes.sql
rename to db/src/main/resources/sql/flyway/V109__add_domain_host_missing_indexes_from_query_analyzer.sql
index 2cd70b406..3437a65d0 100644
--- a/db/src/main/resources/sql/flyway/V107__add_billingevent_domainrepoid_indexes.sql
+++ b/db/src/main/resources/sql/flyway/V109__add_domain_host_missing_indexes_from_query_analyzer.sql
@@ -12,7 +12,5 @@
-- See the License for the specific language governing permissions and
-- limitations under the License.
-
-CREATE INDEX IDXbgfmveqa7e5hn689koikwn70r ON "BillingEvent" (domain_repo_id);
-CREATE INDEX IDXoqttafcywwdn41um6kwlt0n8b ON "BillingRecurrence" (domain_repo_id);
-CREATE INDEX IDXl8vobbecsd32k4ksavdfx8st6 ON "BillingCancellation" (domain_repo_id);
+CREATE INDEX IF NOT EXISTS IDXjw3rwtfrexyq53x9vu7qghrdt
+ ON "DomainHost" (host_repo_id);
diff --git a/db/src/main/resources/sql/flyway/V110__add_graceperiod_missing_indexes_from_query_analyzer.sql b/db/src/main/resources/sql/flyway/V110__add_graceperiod_missing_indexes_from_query_analyzer.sql
new file mode 100644
index 000000000..a137d508a
--- /dev/null
+++ b/db/src/main/resources/sql/flyway/V110__add_graceperiod_missing_indexes_from_query_analyzer.sql
@@ -0,0 +1,18 @@
+-- Copyright 2022 The Nomulus Authors. All Rights Reserved.
+--
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+
+CREATE INDEX IF NOT EXISTS IDXbgssjudpm428mrv0xfpvgifps
+ ON "GracePeriod" (billing_event_id);
+CREATE INDEX IF NOT EXISTS IDX5u5m6clpk3nktrvtyy5umacb6
+ ON "GracePeriod" (billing_recurrence_id);
diff --git a/db/src/main/resources/sql/flyway/V111__add_billingcancellation_missing_indexes.sql b/db/src/main/resources/sql/flyway/V111__add_billingcancellation_missing_indexes.sql
new file mode 100644
index 000000000..8e131d38f
--- /dev/null
+++ b/db/src/main/resources/sql/flyway/V111__add_billingcancellation_missing_indexes.sql
@@ -0,0 +1,20 @@
+-- Copyright 2022 The Nomulus Authors. All Rights Reserved.
+--
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+
+CREATE INDEX IF NOT EXISTS IDX4ytbe5f3b39trsd4okx5ijhs4
+ ON "BillingCancellation" (billing_event_id);
+CREATE INDEX IF NOT EXISTS IDXku0fopwyvd57ebo8bf0jg9xo2
+ ON "BillingCancellation" (billing_recurrence_id);
+CREATE INDEX IF NOT EXISTS IDXl8vobbecsd32k4ksavdfx8st6
+ ON "BillingCancellation" (domain_repo_id);
diff --git a/db/src/main/resources/sql/flyway/V112__add_billingrecurrence_missing_indexes.sql b/db/src/main/resources/sql/flyway/V112__add_billingrecurrence_missing_indexes.sql
new file mode 100644
index 000000000..cf0188319
--- /dev/null
+++ b/db/src/main/resources/sql/flyway/V112__add_billingrecurrence_missing_indexes.sql
@@ -0,0 +1,16 @@
+-- Copyright 2022 The Nomulus Authors. All Rights Reserved.
+--
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+
+CREATE INDEX IF NOT EXISTS IDXoqttafcywwdn41um6kwlt0n8b
+ ON "BillingRecurrence" (domain_repo_id);