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 77de112fb..47b793d7e 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,32 +261,32 @@ td.section { generated on - 2021-07-26 21:31:10.540335 + 2021-08-10 16:04:36.360808 last flyway file - V99__drop_kms_secret_table.sql + V100__database_migration_schedule.sql

 

 

- + SchemaCrawler_Diagram - - + + generated by - + SchemaCrawler 16.10.1 - + generated on - - 2021-07-26 21:31:10.540335 + + 2021-08-10 16:04:36.360808 - + allocationtoken_a08ccbef @@ -501,7 +501,7 @@ td.section { fk_billing_event_cancellation_matching_billing_recurrence_id - + domainhistory_a54cc226 @@ -613,7 +613,7 @@ td.section { fk_billing_event_recurrence_history - + registrar_6e1503e3 @@ -969,10 +969,10 @@ td.section { domain_6c51cffa:w->billingevent_a57d1815:e - + - + @@ -982,13 +982,13 @@ td.section { domain_6c51cffa:w->billingcancellation_6eedf614:e - - - - - - - + + + + + + + fk_domain_transfer_billing_cancellation_id @@ -1228,7 +1228,7 @@ td.section { fk_domain_transfer_losing_registrar_id - + tld_f1fa57e2 @@ -1263,74 +1263,74 @@ td.section { graceperiod_cd3b2e8f - - + + public.GracePeriod - - + + [table] - + grace_period_id - + - + int8 not null - + billing_event_id - + - + int8 - + billing_recurrence_id - + - + int8 - + registrar_id - + - + text not null - + domain_repo_id - + - + text not null - + graceperiod_cd3b2e8f:w->billingevent_a57d1815:e - - - - - - - - + + + + + + + + fk_grace_period_billing_event_id graceperiod_cd3b2e8f:w->domain_6c51cffa:e - - - + + + @@ -1341,22 +1341,22 @@ td.section { graceperiod_cd3b2e8f:w->billingrecurrence_5fa2cb01:e - - - + + + - + - + fk_grace_period_billing_recurrence_id graceperiod_cd3b2e8f:w->registrar_6e1503e3:e - - - + + + @@ -1406,31 +1406,31 @@ td.section { claimsentry_105da9f1 - - + + public.ClaimsEntry - - + + [table] - + revision_id - + - + int8 not null - + domain_label - + - + text not null - + claimslist_3d49bc2b @@ -1459,9 +1459,9 @@ td.section { claimsentry_105da9f1:w->claimslist_3d49bc2b:e - - - + + + @@ -1799,7 +1799,7 @@ td.section { fk_poll_message_domain_history - + host_f21b78de @@ -1864,7 +1864,7 @@ td.section { fk_poll_message_host_repo_id - + hosthistory_56210c2 @@ -1999,33 +1999,53 @@ td.section { cursor_6af40e8c - - + + public."Cursor" - - + + [table] - + "scope" - + - + text not null - + type - + - + text not null - - + + + databasemigrationstateschedule_22edefab + + + public.DatabaseMigrationStateSchedule + + + + [table] + + + id + + + + + int8 not null + + + + delegationsignerdata_e542a872 @@ -2116,7 +2136,7 @@ td.section { fk_domain_history_registrar_id - + domainhost_1ea127c2 @@ -2222,7 +2242,7 @@ td.section { fk_host_last_epp_update_registrar_id - + domaindsdatahistory_995b060d @@ -2284,7 +2304,7 @@ td.section { fko4ilgyyfnvppbpuivus565i0j - + domainhistoryhost_9f3f23ee @@ -2346,7 +2366,7 @@ td.section { fka9woh3hu8gx5x0vly6bai327n - + domaintransactionrecord_6e77ff61 @@ -2434,7 +2454,7 @@ td.section { fk_domain_transaction_record_tld - + graceperiodhistory_40ccc1f1 @@ -2522,145 +2542,145 @@ td.section { fk_history_registrar_id - + lock_f21d4861 - - + + public.Lock - - + + [table] - + resource_name - + - + text not null - + "scope" - + - + text not null - + - + premiumentry_b0060b91 - - + + public.PremiumEntry - - + + [table] - + revision_id - + - + int8 not null - + domain_label - + - + text not null - + - + premiumlist_7c3ea68b - - + + public.PremiumList - - + + [table] - + revision_id - + - + bigserial not null - + - + auto-incremented - + name - + - + text not null - + premiumentry_b0060b91:w->premiumlist_7c3ea68b:e - - - - - - - - + + + + + + + + fko0gw90lpo1tuee56l0nb6y6g5 - + rderevision_83396864 - - + + public.RdeRevision - - + + [table] - + tld - + - + text not null - + mode - + - + text not null - + "date" - + - + date not null - + - + registrarpoc_ab47054d @@ -2709,349 +2729,349 @@ td.section { fk_registrar_poc_registrar_id - + registrylock_ac88663e - - + + public.RegistryLock - - + + [table] - + revision_id - + - + bigserial not null - + - + auto-incremented - + registrar_id - + - + text not null - + repo_id - + - + text not null - + verification_code - + - + text not null - + relock_revision_id - + - + int8 - + registrylock_ac88663e:w->registrylock_ac88663e:e - - - - - - - - + + + + + + + + fk2lhcwpxlnqijr96irylrh1707 - + reservedentry_1a7b8520 - - + + public.ReservedEntry - - + + [table] - + revision_id - + - + int8 not null - + domain_label - + - + text not null - + - + reservedlist_b97c3f1c - - + + public.ReservedList - - + + [table] - + revision_id - + - + bigserial not null - + - + auto-incremented - + name - + - + text not null - + reservedentry_1a7b8520:w->reservedlist_b97c3f1c:e - - - - - - - - + + + + + + + + fkgq03rk0bt1hb915dnyvd3vnfc - + serversecret_6cc90f09 - - + + public.ServerSecret - - + + [table] - + id - + - + int8 not null - + - + signedmarkrevocationentry_99c39721 - - + + public.SignedMarkRevocationEntry - - + + [table] - + revision_id - + - + int8 not null - + smd_id - + - + text not null - + - + signedmarkrevocationlist_c5d968fb - - + + public.SignedMarkRevocationList - - + + [table] - + revision_id - + - + bigserial not null - + - + auto-incremented - + signedmarkrevocationentry_99c39721:w->signedmarkrevocationlist_c5d968fb:e - - - - - - - - + + + + + + + + fk5ivlhvs3121yx2li5tqh54u4 - + spec11threatmatch_a61228a6 - - + + public.Spec11ThreatMatch - - + + [table] - + id - + - + bigserial not null - + - + auto-incremented - + check_date - + - + date not null - + registrar_id - + - + text not null - + tld - + - + text not null - + - + sqlreplaycheckpoint_342081b3 - - + + public.SqlReplayCheckpoint - - + + [table] - + id - + - + int8 not null - + - + tmchcrl_d282355 - - + + public.TmchCrl - - + + [table] - + id - + - + int8 not null - + - + transaction_d50389d4 - - + + public.Transaction - - + + [table] - + id - + - + bigserial not null - + - + auto-incremented - + @@ -4058,6 +4078,36 @@ td.section {

 

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
public.DatabaseMigrationStateSchedule [table] +
idint8 not null
Primary Key
DatabaseMigrationStateSchedule_pkey[primary key]
id
+

 

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 b21c848c8..363a72986 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,19 +261,19 @@ td.section { - + - +
public.DelegationSignerData [table]
generated on2021-07-26 21:31:08.5472042021-08-10 16:04:34.151068
last flyway fileV99__drop_kms_secret_table.sqlV100__database_migration_schedule.sql

 

 

- + SchemaCrawler_Diagram - + generated by @@ -284,7 +284,7 @@ td.section { generated on - 2021-07-26 21:31:08.547204 + 2021-08-10 16:04:34.151068 @@ -661,7 +661,7 @@ td.section { fk_billing_event_cancellation_matching_billing_recurrence_id - + domainhistory_a54cc226 @@ -1277,7 +1277,7 @@ td.section { fk_billing_event_recurrence_history - + registrar_6e1503e3 @@ -2980,7 +2980,7 @@ td.section { fk_domain_transfer_losing_registrar_id - + tld_f1fa57e2 @@ -4535,7 +4535,7 @@ td.section { fk_poll_message_domain_history - + host_f21b78de @@ -4680,7 +4680,7 @@ td.section { fk_poll_message_host_repo_id - + hosthistory_56210c2 @@ -5000,8 +5000,36 @@ td.section { timestamptz not null - + + databasemigrationstateschedule_22edefab + + + public.DatabaseMigrationStateSchedule + + + + [table] + + + id + + + + + int8 not null + + + migration_transitions + + + + + "hstore" + + + + delegationsignerdata_e542a872 @@ -5092,7 +5120,7 @@ td.section { fk_domain_history_registrar_id - + domainhost_1ea127c2 @@ -5198,7 +5226,7 @@ td.section { fk_host_last_epp_update_registrar_id - + domaindsdatahistory_995b060d @@ -5292,7 +5320,7 @@ td.section { fko4ilgyyfnvppbpuivus565i0j - + domainhistoryhost_9f3f23ee @@ -5354,7 +5382,7 @@ td.section { fka9woh3hu8gx5x0vly6bai327n - + domaintransactionrecord_6e77ff61 @@ -5466,7 +5494,7 @@ td.section { fk_domain_transaction_record_tld - + graceperiodhistory_40ccc1f1 @@ -5634,217 +5662,217 @@ td.section { fk_history_registrar_id - + lock_f21d4861 - - + + public.Lock - - + + [table] - + resource_name - + - + text not null - + "scope" - + - + text not null - + acquired_time - + - + timestamptz not null - + expiration_time - + - + timestamptz not null - + request_log_id - + - + text not null - + - + premiumentry_b0060b91 - - + + public.PremiumEntry - - + + [table] - + revision_id - + - + int8 not null - + price - + - + numeric(19, 2) not null - + domain_label - + - + text not null - + - + premiumlist_7c3ea68b - - + + public.PremiumList - - + + [table] - + revision_id - + - + bigserial not null - + - + auto-incremented - + creation_timestamp - + - + timestamptz - + name - + - + text not null - + bloom_filter - + - + bytea not null - + currency - + - + text not null - + premiumentry_b0060b91:w->premiumlist_7c3ea68b:e - - - - - - - - + + + + + + + + fko0gw90lpo1tuee56l0nb6y6g5 - + rderevision_83396864 - - + + public.RdeRevision - - + + [table] - + tld - + - + text not null - + mode - + - + text not null - + "date" - + - + date not null - + update_timestamp - + - + timestamptz - + revision - + - + int4 not null - + - + registrarpoc_ab47054d @@ -5981,541 +6009,541 @@ td.section { fk_registrar_poc_registrar_id - + registrylock_ac88663e - - + + public.RegistryLock - - + + [table] - + revision_id - + - + bigserial not null - + - + auto-incremented - + lock_completion_time - + - + timestamptz - + lock_request_time - + - + timestamptz not null - + domain_name - + - + text not null - + is_superuser - + - + bool not null - + registrar_id - + - + text not null - + registrar_poc_id - + - + text - + repo_id - + - + text not null - + verification_code - + - + text not null - + unlock_request_time - + - + timestamptz - + unlock_completion_time - + - + timestamptz - + last_update_time - + - + timestamptz not null - + relock_revision_id - + - + int8 - + relock_duration - + - + interval - + registrylock_ac88663e:w->registrylock_ac88663e:e - - - - - - - - + + + + + + + + fk2lhcwpxlnqijr96irylrh1707 - + reservedentry_1a7b8520 - - + + public.ReservedEntry - - + + [table] - + revision_id - + - + int8 not null - + comment - + - + text - + reservation_type - + - + int4 not null - + domain_label - + - + text not null - + - + reservedlist_b97c3f1c - - + + public.ReservedList - - + + [table] - + revision_id - + - + bigserial not null - + - + auto-incremented - + creation_timestamp - + - + timestamptz not null - + name - + - + text not null - + should_publish - + - + bool not null - + reservedentry_1a7b8520:w->reservedlist_b97c3f1c:e - - - - - - - - + + + + + + + + fkgq03rk0bt1hb915dnyvd3vnfc - + serversecret_6cc90f09 - - + + public.ServerSecret - - + + [table] - + secret - + - + uuid not null - + id - + - + int8 not null - + - + signedmarkrevocationentry_99c39721 - - + + public.SignedMarkRevocationEntry - - + + [table] - + revision_id - + - + int8 not null - + revocation_time - + - + timestamptz not null - + smd_id - + - + text not null - + - + signedmarkrevocationlist_c5d968fb - - + + public.SignedMarkRevocationList - - + + [table] - + revision_id - + - + bigserial not null - + - + auto-incremented - + creation_time - + - + timestamptz - + signedmarkrevocationentry_99c39721:w->signedmarkrevocationlist_c5d968fb:e - - - - - - - - + + + + + + + + fk5ivlhvs3121yx2li5tqh54u4 - + spec11threatmatch_a61228a6 - - + + public.Spec11ThreatMatch - - + + [table] - + id - + - + bigserial not null - + - + auto-incremented - + check_date - + - + date not null - + domain_name - + - + text not null - + domain_repo_id - + - + text not null - + registrar_id - + - + text not null - + threat_types - + - + _text not null - + tld - + - + text not null - + - + sqlreplaycheckpoint_342081b3 - - + + public.SqlReplayCheckpoint - - + + [table] - + id - + - + int8 not null - + last_replay_time - + - + timestamptz not null - + - + tmchcrl_d282355 - - + + public.TmchCrl - - + + [table] - + certificate_revocations - + - + text not null - + update_timestamp - + - + timestamptz not null - + url - + - + text not null - + id - + - + int8 not null - + - + transaction_d50389d4 - - + + public.Transaction - - + + [table] - + id - + - + bigserial not null - + - + auto-incremented - + contents - + - + bytea - + @@ -8673,6 +8701,71 @@ td.section {

 

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
public.DatabaseMigrationStateSchedule [table] +
idint8 not null
migration_transitions"hstore"
Primary Key
DatabaseMigrationStateSchedule_pkey[primary key]
id
Indexes
DatabaseMigrationStateSchedule_pkey[unique index]
idascending
database_migration_state_schedule_singleton[unique index]
"(true)"ascending
+

 

diff --git a/db/src/main/resources/sql/flyway.txt b/db/src/main/resources/sql/flyway.txt index 04e3c00f7..c382e35e5 100644 --- a/db/src/main/resources/sql/flyway.txt +++ b/db/src/main/resources/sql/flyway.txt @@ -97,3 +97,4 @@ V96__rename_sql_checkpoint_fields.sql V97__add_recurrence_history_id_column_to_onetime.sql V98__add_last_expiring_cert_notification_sent_date.sql V99__drop_kms_secret_table.sql +V100__database_migration_schedule.sql diff --git a/db/src/main/resources/sql/flyway/V100__database_migration_schedule.sql b/db/src/main/resources/sql/flyway/V100__database_migration_schedule.sql new file mode 100644 index 000000000..52ad481b8 --- /dev/null +++ b/db/src/main/resources/sql/flyway/V100__database_migration_schedule.sql @@ -0,0 +1,22 @@ +-- Copyright 2021 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 TABLE "DatabaseMigrationStateSchedule" ( + id int8 NOT NULL, + migration_transitions hstore, + PRIMARY KEY (id) +); + +CREATE UNIQUE INDEX database_migration_state_schedule_singleton + ON "DatabaseMigrationStateSchedule" ((true)); diff --git a/db/src/main/resources/sql/schema/nomulus.golden.sql b/db/src/main/resources/sql/schema/nomulus.golden.sql index e223ca46b..d97840756 100644 --- a/db/src/main/resources/sql/schema/nomulus.golden.sql +++ b/db/src/main/resources/sql/schema/nomulus.golden.sql @@ -315,6 +315,16 @@ CREATE TABLE public."Cursor" ( ); +-- +-- Name: DatabaseMigrationStateSchedule; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public."DatabaseMigrationStateSchedule" ( + id bigint NOT NULL, + migration_transitions public.hstore +); + + -- -- Name: DelegationSignerData; Type: TABLE; Schema: public; Owner: - -- @@ -1208,6 +1218,14 @@ ALTER TABLE ONLY public."Cursor" ADD CONSTRAINT "Cursor_pkey" PRIMARY KEY (scope, type); +-- +-- Name: DatabaseMigrationStateSchedule DatabaseMigrationStateSchedule_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public."DatabaseMigrationStateSchedule" + ADD CONSTRAINT "DatabaseMigrationStateSchedule_pkey" PRIMARY KEY (id); + + -- -- Name: DelegationSignerData DelegationSignerData_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -1455,6 +1473,13 @@ ALTER TABLE ONLY public."DomainHistoryHost" CREATE INDEX allocation_token_domain_name_idx ON public."AllocationToken" USING btree (domain_name); +-- +-- Name: database_migration_state_schedule_singleton; Type: INDEX; Schema: public; Owner: - +-- + +CREATE UNIQUE INDEX database_migration_state_schedule_singleton ON public."DatabaseMigrationStateSchedule" USING btree ((true)); + + -- -- Name: idx1iy7njgb7wjmj9piml4l2g0qi; Type: INDEX; Schema: public; Owner: - --
public.DelegationSignerData [table]