From 91379780838abc620853ba68f9657ab2343d0ae2 Mon Sep 17 00:00:00 2001 From: Lai Jiang Date: Tue, 28 Feb 2023 16:52:02 -0500 Subject: [PATCH] Add a process time column to DnsRefreshRequest (#1948) The value of the column would be set to START_OF_TIME for new entries. Every time a row is read, the value is updated to the current time. This allows concurrent reads to not repeatedly read the same entry that has the earliest request time, because they would only look for rows that have a value of process time that is before current time - some padding time. This basically fulfills the same function that LEASE_PADDING gives us when using a pull queue, whereas a task would be leased for a certain time, during which time they would not be leased by anyone else. See: https://cs.opensource.google/nomulus/nomulus/+/master:core/src/main/java/google/registry/dns/ReadDnsQueueAction.java;l=99?q=readdnsqueue&ss=nomulus%2Fnomulus --- .../sql/er_diagram/brief_er_diagram.html | 2353 +++++++++-------- .../sql/er_diagram/full_er_diagram.html | 729 ++--- db/src/main/resources/sql/flyway.txt | 1 + .../flyway/V137__add_process_time_column.sql | 18 + .../resources/sql/schema/nomulus.golden.sql | 10 +- 5 files changed, 1588 insertions(+), 1523 deletions(-) create mode 100644 db/src/main/resources/sql/flyway/V137__add_process_time_column.sql 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 30d89b20c..d4293f0a5 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,75 +261,75 @@ td.section { generated on - 2023-02-17 21:19:44.96188 + 2023-02-28 21:00:55.560072 last flyway file - V136__add_dns_refresh_request_table.sql + V137__add_process_time_column.sql

 

 

- + SchemaCrawler_Diagram - - + + generated by - + SchemaCrawler 16.10.1 - + generated on - - 2023-02-17 21:19:44.96188 + + 2023-02-28 21:00:55.560072 - + allocationtoken_a08ccbef - - + + public.AllocationToken - - + + [table] - + token - + - + text not null - + domain_name - + - + text - + redemption_domain_repo_id - + - + text - + token_type - + - + text - + billingevent_a57d1815 @@ -425,947 +425,947 @@ td.section { billingevent_a57d1815:w->allocationtoken_a08ccbef:e - - - - - - - - + + + + + + + + fk_billing_event_allocation_token domainhistory_a54cc226 - - + + public.DomainHistory - - + + [table] - + history_revision_id - + - + int8 not null - + history_registrar_id - + - + text - + history_modification_time - + - + timestamptz not null - + history_type - + - + text not null - + creation_time - + - + timestamptz - + domain_repo_id - + - + text not null - + current_package_token - + - + text - + billingevent_a57d1815:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fk_billing_event_domain_history billingevent_a57d1815:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fk_billing_event_domain_history billingevent_a57d1815:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fk_billing_event_recurrence_history billingevent_a57d1815:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fk_billing_event_recurrence_history billingrecurrence_5fa2cb01 - - + + public.BillingRecurrence - - + + [table] - + billing_recurrence_id - + - + int8 not null - + registrar_id - + - + text not null - + domain_history_revision_id - + - + int8 not null - + domain_repo_id - + - + text not null - + event_time - + - + timestamptz not null - + recurrence_end_time - + - + timestamptz - + recurrence_time_of_year - + - + text - + recurrence_last_expansion - + - + timestamptz not null - + billingevent_a57d1815:w->billingrecurrence_5fa2cb01:e - - - - - - - - + + + + + + + + fk_billing_event_cancellation_matching_billing_recurrence_id registrar_6e1503e3 - - + + public.Registrar - - + + [table] - + registrar_id - + - + text not null - + iana_identifier - + - + int8 - + registrar_name - + - + text not null - + billingevent_a57d1815:w->registrar_6e1503e3:e - + - - - - - + + + + + fk_billing_event_registrar_id domain_6c51cffa - - + + public.Domain - - + + [table] - + repo_id - + - + text not null - + creation_registrar_id - + - + text not null - + creation_time - + - + timestamptz not null - + current_sponsor_registrar_id - + - + text not null - + deletion_time - + - + timestamptz - + last_epp_update_registrar_id - + - + text - + domain_name - + - + text - + tld - + - + text - + admin_contact - + - + text - + billing_contact - + - + text - + registrant_contact - + - + text - + tech_contact - + - + text - + transfer_billing_cancellation_id - + - + int8 - + transfer_billing_event_id - + - + int8 - + transfer_billing_recurrence_id - + - + int8 - + transfer_gaining_registrar_id - + - + text - + transfer_losing_registrar_id - + - + text - + billing_recurrence_id - + - + int8 - + autorenew_end_time - + - + timestamptz - + dns_refresh_request_time - + - + timestamptz - + current_package_token - + - + text - + lordn_phase - + - + text not null - + domain_6c51cffa:w->allocationtoken_a08ccbef:e - - - - - - - - + + + + + + + + fk_domain_current_package_token domain_6c51cffa:w->billingevent_a57d1815:e - - - + + + - + fk_domain_transfer_billing_event_id billingcancellation_6eedf614 - - + + public.BillingCancellation - - + + [table] - + billing_cancellation_id - + - + int8 not null - + registrar_id - + - + text not null - + domain_history_revision_id - + - + int8 not null - + domain_repo_id - + - + text not null - + event_time - + - + timestamptz not null - + billing_time - + - + timestamptz - + billing_event_id - + - + int8 - + billing_recurrence_id - + - + int8 - + domain_6c51cffa:w->billingcancellation_6eedf614:e - - - - - - - - + + + + + + + + fk_domain_transfer_billing_cancellation_id domain_6c51cffa:w->billingrecurrence_5fa2cb01:e - - - - - - - - + + + + + + + + fk_domain_billing_recurrence_id domain_6c51cffa:w->billingrecurrence_5fa2cb01:e - - - - - - - - + + + + + + + + fk_domain_transfer_billing_recurrence_id contact_8de8cb16 - - + + public.Contact - - + + [table] - + repo_id - + - + text not null - + creation_registrar_id - + - + text not null - + creation_time - + - + timestamptz not null - + current_sponsor_registrar_id - + - + text not null - + deletion_time - + - + timestamptz - + last_epp_update_registrar_id - + - + text - + contact_id - + - + text - + search_name - + - + text - + transfer_gaining_registrar_id - + - + text - + transfer_losing_registrar_id - + - + text - + domain_6c51cffa:w->contact_8de8cb16:e - - - - - - - - + + + + + + + + fk_domain_admin_contact domain_6c51cffa:w->contact_8de8cb16:e - - - - - - - - + + + + + + + + fk_domain_billing_contact domain_6c51cffa:w->contact_8de8cb16:e - - - - - - - - + + + + + + + + fk_domain_registrant_contact domain_6c51cffa:w->contact_8de8cb16:e - - - - - - - - + + + + + + + + fk_domain_tech_contact domain_6c51cffa:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk2jc69qyg2tv9hhnmif6oa1cx1 domain_6c51cffa:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk2u3srsfbei272093m3b3xwj23 domain_6c51cffa:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fkjc0r9r5y1lfbt4gpbqw4wsuvq domain_6c51cffa:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_domain_transfer_gaining_registrar_id domain_6c51cffa:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_domain_transfer_losing_registrar_id tld_f1fa57e2 - - + + public.Tld - - + + [table] - + tld_name - + - + text not null - + domain_6c51cffa:w->tld_f1fa57e2:e - - - - - - - - + + + + + + + + fk_domain_tld domainhistory_a54cc226:w->allocationtoken_a08ccbef:e - - - - - - - - + + + + + + + + fk_domain_history_current_package_token domainhistory_a54cc226:w->domain_6c51cffa:e - - - - - - - - + + + + + + + + fk_domain_history_domain_repo_id domainhistory_a54cc226:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_domain_history_registrar_id billingcancellation_6eedf614:w->billingevent_a57d1815:e - - - + + + - + fk_billing_cancellation_billing_event_id billingcancellation_6eedf614:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fk_billing_cancellation_domain_history billingcancellation_6eedf614:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fk_billing_cancellation_domain_history billingcancellation_6eedf614:w->billingrecurrence_5fa2cb01:e - - - - - - - - + + + + + + + + fk_billing_cancellation_billing_recurrence_id billingcancellation_6eedf614:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_billing_cancellation_registrar_id @@ -1436,474 +1436,474 @@ td.section { graceperiod_cd3b2e8f:w->domain_6c51cffa:e - + - - - - + + + + fk_grace_period_domain_repo_id graceperiod_cd3b2e8f:w->billingrecurrence_5fa2cb01:e - + - - - - - + + + + + fk_grace_period_billing_recurrence_id graceperiod_cd3b2e8f:w->registrar_6e1503e3:e - + - - - - + + + + fk_grace_period_registrar_id billingrecurrence_5fa2cb01:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fk_billing_recurrence_domain_history billingrecurrence_5fa2cb01:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fk_billing_recurrence_domain_history billingrecurrence_5fa2cb01:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_billing_recurrence_registrar_id claimsentry_105da9f1 - - + + public.ClaimsEntry - - + + [table] - + revision_id - + - + int8 not null - + domain_label - + - + text not null - + claimslist_3d49bc2b - - + + public.ClaimsList - - + + [table] - + revision_id - + - + bigserial not null - + - + auto-incremented - + claimsentry_105da9f1:w->claimslist_3d49bc2b:e - - - - - - - - + + + + + + + + fk6sc6at5hedffc0nhdcab6ivuq contact_8de8cb16:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk1sfyj7o7954prbn1exk7lpnoe contact_8de8cb16:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk93c185fx7chn68uv7nl6uv2s0 contact_8de8cb16:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fkmb7tdiv85863134w1wogtxrb2 contact_8de8cb16:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_contact_transfer_gaining_registrar_id contact_8de8cb16:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_contact_transfer_losing_registrar_id contacthistory_d2964f8a - - + + public.ContactHistory - - + + [table] - + history_revision_id - + - + int8 not null - + history_registrar_id - + - + text - + history_modification_time - + - + timestamptz not null - + history_type - + - + text not null - + creation_time - + - + timestamptz - + contact_repo_id - + - + text not null - + contacthistory_d2964f8a:w->contact_8de8cb16:e - - - - - - - - + + + + + + + + fk_contact_history_contact_repo_id contacthistory_d2964f8a:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_contact_history_registrar_id pollmessage_614a523e - - + + public.PollMessage - - + + [table] - + poll_message_id - + - + int8 not null - + registrar_id - + - + text not null - + contact_repo_id - + - + text - + contact_history_revision_id - + - + int8 - + domain_repo_id - + - + text - + domain_history_revision_id - + - + int8 - + event_time - + - + timestamptz not null - + host_repo_id - + - + text - + host_history_revision_id - + - + int8 - + transfer_response_gaining_registrar_id - + - + text - + transfer_response_losing_registrar_id - + - + text - + pollmessage_614a523e:w->domain_6c51cffa:e - - - - - - - - + + + + + + + + fk_poll_message_domain_repo_id pollmessage_614a523e:w->domainhistory_a54cc226:e - - - - - - - + + + + + + + fk_poll_message_domain_history pollmessage_614a523e:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fk_poll_message_domain_history pollmessage_614a523e:w->contact_8de8cb16:e - - - - - - - - + + + + + + + + fk_poll_message_contact_repo_id pollmessage_614a523e:w->contacthistory_d2964f8a:e - - - - - - - - + + + + + + + + fk_poll_message_contact_history pollmessage_614a523e:w->contacthistory_d2964f8a:e - - - - - - - - + + + + + + + + fk_poll_message_contact_history @@ -2001,197 +2001,197 @@ td.section { pollmessage_614a523e:w->host_f21b78de:e - - - - - - - - + + + + + + + + fk_poll_message_host_repo_id hosthistory_56210c2 - - + + public.HostHistory - - + + [table] - + history_revision_id - + - + int8 not null - + history_registrar_id - + - + text not null - + history_modification_time - + - + timestamptz not null - + history_type - + - + text not null - + host_name - + - + text - + creation_time - + - + timestamptz - + host_repo_id - + - + text not null - + pollmessage_614a523e:w->hosthistory_56210c2:e - - - - - - - - + + + + + + + + fk_poll_message_host_history pollmessage_614a523e:w->hosthistory_56210c2:e - - - - - - - - + + + + + + + + fk_poll_message_host_history pollmessage_614a523e:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_poll_message_registrar_id pollmessage_614a523e:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_poll_message_transfer_response_gaining_registrar_id pollmessage_614a523e:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_poll_message_transfer_response_losing_registrar_id cursor_6af40e8c - - + + public."Cursor" - - + + [table] - + "scope" - + - + text not null - + type - + - + text not null - + databasemigrationstateschedule_22edefab - - + + public.DatabaseMigrationStateSchedule - - + + [table] - + id - + - + int8 not null - + delegationsignerdata_e542a872 @@ -2247,153 +2247,161 @@ td.section { delegationsignerdata_e542a872:w->domain_6c51cffa:e - + - - - - - + + + + + fktr24j9v14ph2mfuw2gsmt12kq dnsrefreshrequest_4e6affb3 - - + + public.DnsRefreshRequest - - + + [table] - + id - + - + bigserial not null - + - + auto-incremented - + request_time - + - + timestamptz not null - + + process_time + + + + + timestamptz not null + + domainhost_1ea127c2 - - + + public.DomainHost - - + + [table] - + domain_repo_id - + - + text not null - + host_repo_id - + - + text - + domainhost_1ea127c2:w->domain_6c51cffa:e - - - - - - - + + + + + + + fkfmi7bdink53swivs390m2btxg domainhost_1ea127c2:w->host_f21b78de:e - - - - - - - - + + + + + + + + fk_domainhost_host_valid host_f21b78de:w->domain_6c51cffa:e - - - - - - - + + + + + + + fk_host_superordinate_domain host_f21b78de:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_host_creation_registrar_id host_f21b78de:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_host_current_sponsor_registrar_id host_f21b78de:w->registrar_6e1503e3:e - - + + - - - - - + + + + + fk_host_last_epp_update_registrar_id @@ -2435,27 +2443,27 @@ td.section { domaindsdatahistory_995b060d:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fko4ilgyyfnvppbpuivus565i0j domaindsdatahistory_995b060d:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fko4ilgyyfnvppbpuivus565i0j @@ -2497,27 +2505,27 @@ td.section { domainhistoryhost_9f3f23ee:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fka9woh3hu8gx5x0vly6bai327n domainhistoryhost_9f3f23ee:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fka9woh3hu8gx5x0vly6bai327n @@ -2572,40 +2580,40 @@ td.section { domaintransactionrecord_6e77ff61:w->domainhistory_a54cc226:e - + - - - - - + + + + + fkcjqe54u72kha71vkibvxhjye7 domaintransactionrecord_6e77ff61:w->domainhistory_a54cc226:e - - - - - - - + + + + + + + fkcjqe54u72kha71vkibvxhjye7 domaintransactionrecord_6e77ff61:w->tld_f1fa57e2:e - + - - - - - - + + + + + + fk_domain_transaction_record_tld @@ -2647,226 +2655,226 @@ td.section { graceperiodhistory_40ccc1f1:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fk7w3cx8d55q8bln80e716tr7b8 graceperiodhistory_40ccc1f1:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fk7w3cx8d55q8bln80e716tr7b8 hosthistory_56210c2:w->host_f21b78de:e - - - - - - - + + + + + + + fk_hosthistory_host hosthistory_56210c2:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_history_registrar_id lock_f21d4861 - - + + public.Lock - - + + [table] - + resource_name - + - + text not null - + "scope" - + - + text not null - + packagepromotion_56aa33 - - + + public.PackagePromotion - - + + [table] - + package_promotion_id - + - + bigserial not null - + - + auto-incremented - + token - + - + 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 @@ -2906,356 +2914,356 @@ td.section { registrarpoc_ab47054d:w->registrar_6e1503e3:e - + - - - - + + + + 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 - + tmchcrl_d282355 - - + + public.TmchCrl - - + + [table] - + id - + - + int8 not null - + user_f2216f01 - - + + public."User" - - + + [table] - + id - + - + bigserial not null - + - + auto-incremented - + email_address - + - + text not null - + gaia_id - + - + text - + @@ -4438,6 +4446,11 @@ td.section { request_time timestamptz not null + + + process_time + timestamptz not null + 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 d810768c8..0d0535b2c 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 { generated on - 2023-02-17 21:19:43.349101 + 2023-02-28 21:00:53.216736 last flyway file - V136__add_dns_refresh_request_table.sql + V137__add_process_time_column.sql

 

 

- + SchemaCrawler_Diagram - + generated by @@ -284,7 +284,7 @@ td.section { generated on - 2023-02-17 21:19:43.349101 + 2023-02-28 21:00:53.216736 @@ -5116,60 +5116,68 @@ td.section { dnsrefreshrequest_4e6affb3 - - + + public.DnsRefreshRequest - - + + [table] - + id - + - + bigserial not null - + - + auto-incremented - + name - + - + text not null - + request_time - + - + timestamptz not null - + tld - + - + text not null - + type - + - + text not null - + + process_time + + + + + timestamptz not null + + domainhost_1ea127c2 @@ -5683,32 +5691,40 @@ td.section { lock_f21d4861 - - + + public.Lock - - + + [table] - + resource_name + + + + text not null + + + "scope" + text not null - - "scope" + + acquired_time - text not null + timestamptz not null - acquired_time + expiration_time @@ -5716,56 +5732,56 @@ td.section { timestamptz not null - expiration_time + request_log_id - timestamptz not null - - - request_log_id - - - - text - + packagepromotion_56aa33 - - + + public.PackagePromotion - - + + [table] - + package_promotion_id + + + + bigserial not null + - bigserial not null + auto-incremented + + + last_notification_sent - auto-incremented + timestamptz - last_notification_sent + max_creates - timestamptz + int4 not null - max_creates + max_domains @@ -5773,204 +5789,196 @@ td.section { int4 not null - max_domains + next_billing_date - int4 not null + timestamptz not null - next_billing_date + package_price_amount - timestamptz not null + numeric(19, 2) not null - package_price_amount + package_price_currency - numeric(19, 2) not null + text not null - package_price_currency + token text not null - - token - - - - - text not null - - + premiumentry_b0060b91 - - + + public.PremiumEntry - - + + [table] - + revision_id + + + + int8 not null + + + price + - int8 not null + numeric(19, 2) not null - - price + + domain_label - numeric(19, 2) not null - - - domain_label - - - - text not null - + premiumlist_7c3ea68b - - + + public.PremiumList - - + + [table] - + revision_id + + + + bigserial not null + - bigserial not null + auto-incremented + + + creation_timestamp - auto-incremented + timestamptz - creation_timestamp + name - timestamptz + text not null - name + bloom_filter - text not null + bytea not null - bloom_filter + currency - 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 - mode + "date" - text not null + date not null - - "date" + + update_timestamp - date not null + timestamptz - update_timestamp + revision - timestamptz - - - revision - - - - int4 not null - + registrarpoc_ab47054d @@ -6111,77 +6119,85 @@ td.section { registrylock_ac88663e - - + + public.RegistryLock - - + + [table] - + revision_id + + + + bigserial not null + - bigserial not null + auto-incremented + + + lock_completion_time - auto-incremented + timestamptz - lock_completion_time + lock_request_time - timestamptz + timestamptz not null - lock_request_time + domain_name - timestamptz not null + text not null - domain_name + is_superuser - text not null + bool not null - is_superuser + registrar_id - bool not null + text not null - registrar_id + registrar_poc_id - text not null + text - registrar_poc_id + repo_id - text + text not null - repo_id + verification_code @@ -6189,15 +6205,15 @@ td.section { text not null - verification_code + unlock_request_time - text not null + timestamptz - unlock_request_time + unlock_completion_time @@ -6205,301 +6221,301 @@ td.section { timestamptz - unlock_completion_time + last_update_time - timestamptz + timestamptz not null - last_update_time + relock_revision_id - timestamptz not null + int8 - relock_revision_id + relock_duration - int8 - - - relock_duration - - - - interval - + registrylock_ac88663e:w->registrylock_ac88663e:e - - - - - - - - + + + + + + + + fk2lhcwpxlnqijr96irylrh1707 reservedentry_1a7b8520 - - + + public.ReservedEntry - - + + [table] - + revision_id + + + + int8 not null + + + comment + - int8 not null + text - comment + reservation_type - text + int4 not null - - reservation_type + + domain_label - int4 not null - - - domain_label - - - - text not null - + reservedlist_b97c3f1c - - + + public.ReservedList - - + + [table] - + revision_id + + + + bigserial not null + - bigserial not null + auto-incremented + + + creation_timestamp - auto-incremented + timestamptz not null - creation_timestamp + name - timestamptz not null + text not null - name + should_publish - 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 + - uuid not null - - - id - - - - int8 not null - + signedmarkrevocationentry_99c39721 - - + + public.SignedMarkRevocationEntry - - + + [table] - + revision_id + + + + int8 not null + + + revocation_time + - int8 not null + timestamptz not null - - revocation_time + + smd_id - timestamptz not null - - - smd_id - - - - text not null - + signedmarkrevocationlist_c5d968fb - - + + public.SignedMarkRevocationList - - + + [table] - + revision_id + + + + bigserial not null + - bigserial not null + auto-incremented + + + creation_time - auto-incremented - - - creation_time - - - - timestamptz - + signedmarkrevocationentry_99c39721:w->signedmarkrevocationlist_c5d968fb:e - - - - - - - - + + + + + + + + fk5ivlhvs3121yx2li5tqh54u4 spec11threatmatch_a61228a6 - - + + public.Spec11ThreatMatch - - + + [table] - + id + + + + bigserial not null + - bigserial not null + auto-incremented + + + check_date - auto-incremented + date not null - check_date + domain_name - date not null + text not null - domain_name + domain_repo_id @@ -6507,7 +6523,7 @@ td.section { text not null - domain_repo_id + registrar_id @@ -6515,108 +6531,108 @@ td.section { text not null - registrar_id + threat_types - text not null + _text not null - threat_types + tld - _text not null - - - tld - - - - text not null - + tmchcrl_d282355 - - + + public.TmchCrl - - + + [table] - + certificate_revocations + + + + text not null + + + update_timestamp + - text not null + timestamptz not null - update_timestamp + url - timestamptz not null + text not null - - url + + id - text not null - - - id - - - - int8 not null - + user_f2216f01 - - + + public."User" - - + + [table] - + id + + + + bigserial not null + - bigserial not null + auto-incremented + + + email_address - auto-incremented + text not null - email_address + gaia_id - text not null + text - gaia_id + registry_lock_password_hash @@ -6624,7 +6640,7 @@ td.section { text - registry_lock_password_hash + registry_lock_password_salt @@ -6632,46 +6648,38 @@ td.section { text - registry_lock_password_salt + global_role - text + text not null - global_role + is_admin - text not null + bool not null - is_admin + registrar_roles - bool not null + "hstore" not null - registrar_roles + update_timestamp - "hstore" not null - - - update_timestamp - - - - timestamptz - + @@ -9208,6 +9216,11 @@ td.section { type text not null +
+ + process_time + timestamptz not null +
@@ -9247,6 +9260,18 @@ td.section {
+
+ idx3i7i2ktts9d7lcjbs34h0pvwo + [non-unique index] +
+
+ + process_time + ascending +
+
+ +
idx8gtvnbk64yskcvrdp61f5ied3 [non-unique index] diff --git a/db/src/main/resources/sql/flyway.txt b/db/src/main/resources/sql/flyway.txt index ee27964d4..e491432bb 100644 --- a/db/src/main/resources/sql/flyway.txt +++ b/db/src/main/resources/sql/flyway.txt @@ -134,3 +134,4 @@ V133__add_pull_queue_replace_columns.sql V134__drop_not_null_request_id_lock_table.sql V135__null_gaia_id_user.sql V136__add_dns_refresh_request_table.sql +V137__add_process_time_column.sql diff --git a/db/src/main/resources/sql/flyway/V137__add_process_time_column.sql b/db/src/main/resources/sql/flyway/V137__add_process_time_column.sql new file mode 100644 index 000000000..4fd4b6037 --- /dev/null +++ b/db/src/main/resources/sql/flyway/V137__add_process_time_column.sql @@ -0,0 +1,18 @@ +-- Copyright 2023 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. + +ALTER TABLE "DnsRefreshRequest" + ADD COLUMN IF NOT EXISTS process_time timestamptz NOT NULL; + +CREATE INDEX IDX3i7i2ktts9d7lcjbs34h0pvwo ON "DnsRefreshRequest" (process_time); diff --git a/db/src/main/resources/sql/schema/nomulus.golden.sql b/db/src/main/resources/sql/schema/nomulus.golden.sql index 5d4905acb..46e3af0e7 100644 --- a/db/src/main/resources/sql/schema/nomulus.golden.sql +++ b/db/src/main/resources/sql/schema/nomulus.golden.sql @@ -349,7 +349,8 @@ CREATE TABLE public."DnsRefreshRequest" ( name text NOT NULL, request_time timestamp with time zone NOT NULL, tld text NOT NULL, - type text NOT NULL + type text NOT NULL, + process_time timestamp with time zone NOT NULL ); @@ -1627,6 +1628,13 @@ CREATE INDEX idx1rcgkdd777bpvj0r94sltwd5y ON public."Domain" USING btree (domain CREATE INDEX idx2exdfbx6oiiwnhr8j6gjpqt2j ON public."BillingCancellation" USING btree (event_time); +-- +-- Name: idx3i7i2ktts9d7lcjbs34h0pvwo; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX idx3i7i2ktts9d7lcjbs34h0pvwo ON public."DnsRefreshRequest" USING btree (process_time); + + -- -- Name: idx3y3k7m2bkgahm9sixiohgyrga; Type: INDEX; Schema: public; Owner: - --