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 36d75846a..67d884555 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-11-10 15:30:26.16648 + 2022-11-11 20:37:39.246068 last flyway file - V130__add_login_email_column_to_registrarpoc.sql + V131__add_default_promo_tokens_to_registry.sql @@ -274,19 +274,19 @@ td.section { SchemaCrawler_Diagram - + generated by - + SchemaCrawler 16.10.1 - + generated on - - 2022-11-10 15:30:26.16648 + + 2022-11-11 20:37:39.246068 - + allocationtoken_a08ccbef 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 6b3e2de30..1110849b7 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-11-10 15:30:23.82067 + 2022-11-11 20:37:37.271018
last flyway file - V130__add_login_email_column_to_registrarpoc.sql + V131__add_default_promo_tokens_to_registry.sql
@@ -274,150 +274,150 @@ td.section { SchemaCrawler_Diagram - + generated by - + SchemaCrawler 16.10.1 - + generated on - - 2022-11-10 15:30:23.82067 + + 2022-11-11 20:37:37.271018 - + allocationtoken_a08ccbef - - + + public.AllocationToken - - + + [table] - + token - + - + text not null - + update_timestamp - + - + timestamptz - + allowed_registrar_ids - + - + _text - + allowed_tlds - + - + _text - + creation_time - + - + timestamptz not null - + discount_fraction - + - + float8(17, 17) not null - + discount_premiums - + - + bool not null - + discount_years - + - + int4 not null - + domain_name - + - + text - + redemption_domain_repo_id - + - + text - + token_status_transitions - + - + "hstore" - + token_type - + - + text - + redemption_domain_history_id - + - + int8 - + renewal_price_behavior - + - + text not null - + registration_behavior - + - + text not null - + billingevent_a57d1815 @@ -561,13 +561,13 @@ td.section { billingevent_a57d1815:w->allocationtoken_a08ccbef:e - + - - - - + + + + fk_billing_event_allocation_token @@ -1166,530 +1166,530 @@ td.section { 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 - + flags - + - + _text - + reason - + - + text not null - + domain_name - + - + text not null - + recurrence_end_time - + - + timestamptz - + recurrence_time_of_year - + - + text - + renewal_price_behavior - + - + text not null - + renewal_price_currency - + - + text - + renewal_price_amount - + - + numeric(19, 2) - + 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 - + allowed_tlds - + - + _text - + billing_account_map - + - + "hstore" - + block_premium_names - + - + bool not null - + client_certificate - + - + text - + client_certificate_hash - + - + text - + contacts_require_syncing - + - + bool not null - + creation_time - + - + timestamptz not null - + drive_folder_id - + - + text - + email_address - + - + text - + failover_client_certificate - + - + text - + failover_client_certificate_hash - + - + text - + fax_number - + - + text - + iana_identifier - + - + int8 - + icann_referral_email - + - + text - + i18n_address_city - + - + text - + i18n_address_country_code - + - + text - + i18n_address_state - + - + text - + i18n_address_street_line1 - + - + text - + i18n_address_street_line2 - + - + text - + i18n_address_street_line3 - + - + text - + i18n_address_zip - + - + text - + ip_address_allow_list - + - + _text - + last_certificate_update_time - + - + timestamptz - + last_update_time - + - + timestamptz not null - + localized_address_city - + - + text - + localized_address_country_code - + - + text - + localized_address_state - + - + text - + localized_address_street_line1 - + - + text - + localized_address_street_line2 - + - + text - + localized_address_street_line3 - + - + text - + localized_address_zip - + - + text - + password_hash - + - + text - + phone_number - + - + text - + phone_passcode - + - + text - + po_number - + - + text - + rdap_base_urls - + - + _text - + registrar_name - + - + text not null - + registry_lock_allowed - + - + bool not null - + password_salt - + - + text - + state - + - + text - + type - + - + text not null - + url - + - + text - + whois_server - + - + text - + last_expiring_cert_notification_sent_date - + - + timestamptz - + last_expiring_failover_cert_notification_sent_date - + - + timestamptz - + billingevent_a57d1815:w->registrar_6e1503e3:e - + - - - - + + + + fk_billing_event_registrar_id @@ -2124,13 +2124,13 @@ td.section { domain_6c51cffa:w->allocationtoken_a08ccbef:e - + - - - - + + + + fk_domain_current_package_token @@ -2150,139 +2150,139 @@ td.section { 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 - + flags - + - + _text - + reason - + - + text not null - + domain_name - + - + text 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 @@ -2765,40 +2765,40 @@ td.section { 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 @@ -2817,408 +2817,416 @@ td.section { 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 - + add_grace_period_length - + - + interval not null - + allowed_fully_qualified_host_names - + - + _text - + allowed_registrant_contact_ids - + - + _text - + anchor_tenant_add_grace_period_length - + - + interval not null - + auto_renew_grace_period_length - + - + interval not null - + automatic_transfer_length - + - + interval not null - + claims_period_end - + - + timestamptz not null - + create_billing_cost_amount - + - + numeric(19, 2) - + create_billing_cost_currency - + - + text - + creation_time - + - + timestamptz not null - + currency - + - + text not null - + dns_paused - + - + bool not null - + dns_writers - + - + _text not null - + drive_folder_id - + - + text - + eap_fee_schedule - + - + "hstore" not null - + escrow_enabled - + - + bool not null - + invoicing_enabled - + - + bool not null - + lordn_username - + - + text - + num_dns_publish_locks - + - + int4 not null - + pending_delete_length - + - + interval not null - + premium_list_name - + - + text - + pricing_engine_class_name - + - + text - + redemption_grace_period_length - + - + interval not null - + registry_lock_or_unlock_cost_amount - + - + numeric(19, 2) - + registry_lock_or_unlock_cost_currency - + - + text - + renew_billing_cost_transitions - + - + "hstore" not null - + renew_grace_period_length - + - + interval not null - + reserved_list_names - + - + _text - + restore_billing_cost_amount - + - + numeric(19, 2) - + restore_billing_cost_currency - + - + text - + roid_suffix - + - + text - + server_status_change_billing_cost_amount - + - + numeric(19, 2) - + server_status_change_billing_cost_currency - + - + text - + tld_state_transitions - + - + "hstore" not null - + tld_type - + - + text not null - + tld_unicode - + - + text not null - + transfer_grace_period_length - + - + interval not null - + + default_promo_tokens + + + + + _text + + domain_6c51cffa:w->tld_f1fa57e2:e - + - - - - + + + + fk_domain_tld domainhistory_a54cc226:w->allocationtoken_a08ccbef:e - - - - - - - - + + + + + + + + fk_domain_history_current_package_token @@ -3237,22 +3245,22 @@ td.section {
domainhistory_a54cc226:w->registrar_6e1503e3:e - + - - - - - + + + + + fk_domain_history_registrar_id billingcancellation_6eedf614:w->billingevent_a57d1815:e - - - + + + @@ -3263,22 +3271,22 @@ td.section { billingcancellation_6eedf614:w->domainhistory_a54cc226:e - - - + + + - + fk_billing_cancellation_domain_history billingcancellation_6eedf614:w->domainhistory_a54cc226:e - - - + + + @@ -3289,27 +3297,27 @@ td.section { billingcancellation_6eedf614:w->billingrecurrence_5fa2cb01:e - - - - - - - - + + + + + + + + fk_billing_cancellation_billing_recurrence_id billingcancellation_6eedf614:w->registrar_6e1503e3:e - - - - - - - - + + + + + + + + fk_billing_cancellation_registrar_id @@ -3409,66 +3417,66 @@ td.section {
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 @@ -3564,66 +3572,66 @@ td.section { 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 @@ -4198,13 +4206,13 @@ td.section { contacthistory_d2964f8a:w->registrar_6e1503e3:e - + - - - - + + + + fk_contact_history_registrar_id @@ -4478,14 +4486,14 @@ td.section { pollmessage_614a523e:w->contact_8de8cb16:e - + - - - - - + + + + + fk_poll_message_contact_repo_id @@ -4900,39 +4908,39 @@ td.section { 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 @@ -5143,196 +5151,196 @@ td.section { 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 domaindsdatahistory_995b060d - - + + public.DomainDsDataHistory - - + + [table] - + ds_data_history_revision_id - + - + int8 not null - + algorithm - + - + int4 not null - + digest - + - + bytea not null - + digest_type - + - + int4 not null - + domain_history_revision_id - + - + int8 not null - + key_tag - + - + int4 not null - + domain_repo_id - + - + text - + domaindsdatahistory_995b060d:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fko4ilgyyfnvppbpuivus565i0j domaindsdatahistory_995b060d:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fko4ilgyyfnvppbpuivus565i0j domainhistoryhost_9f3f23ee - - + + public.DomainHistoryHost - - + + [table] - + domain_history_history_revision_id - + - + int8 not null - + host_repo_id - + - + text - + domain_history_domain_repo_id - + - + text not null - + domainhistoryhost_9f3f23ee:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fka9woh3hu8gx5x0vly6bai327n domainhistoryhost_9f3f23ee:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fka9woh3hu8gx5x0vly6bai327n @@ -5437,123 +5445,123 @@ td.section { domaintransactionrecord_6e77ff61:w->tld_f1fa57e2:e - + - - - - + + + + fk_domain_transaction_record_tld graceperiodhistory_40ccc1f1 - - + + public.GracePeriodHistory - - + + [table] - + grace_period_history_revision_id - + - + int8 not null - + billing_event_id - + - + int8 - + billing_recurrence_id - + - + int8 - + registrar_id - + - + text not null - + domain_repo_id - + - + text not null - + expiration_time - + - + timestamptz not null - + type - + - + text not null - + domain_history_revision_id - + - + int8 - + grace_period_id - + - + int8 not null - + graceperiodhistory_40ccc1f1:w->domainhistory_a54cc226:e - - - - - - - - + + + + + + + + fk7w3cx8d55q8bln80e716tr7b8 graceperiodhistory_40ccc1f1:w->domainhistory_a54cc226:e - - - - - - - + + + + + + + fk7w3cx8d55q8bln80e716tr7b8 @@ -5573,13 +5581,13 @@ td.section { hosthistory_56210c2:w->registrar_6e1503e3:e - - - - - - - + + + + + + + fk_history_registrar_id @@ -6009,13 +6017,13 @@ td.section { registrarpoc_ab47054d:w->registrar_6e1503e3:e - + - - - - + + + + fk_registrar_poc_registrar_id @@ -14133,6 +14141,11 @@ td.section { transfer_grace_period_length interval not null +
+ + default_promo_tokens + _text +
diff --git a/db/src/main/resources/sql/flyway.txt b/db/src/main/resources/sql/flyway.txt index c71815f12..09390a4a1 100644 --- a/db/src/main/resources/sql/flyway.txt +++ b/db/src/main/resources/sql/flyway.txt @@ -128,3 +128,4 @@ V127__fix_user.sql V128__fix_package_promotion_id.sql V129__create_allocateId_sequence_alternative.sql V130__add_login_email_column_to_registrarpoc.sql +V131__add_default_promo_tokens_to_registry.sql diff --git a/db/src/main/resources/sql/flyway/V131__add_default_promo_tokens_to_registry.sql b/db/src/main/resources/sql/flyway/V131__add_default_promo_tokens_to_registry.sql new file mode 100644 index 000000000..fea7f2d45 --- /dev/null +++ b/db/src/main/resources/sql/flyway/V131__add_default_promo_tokens_to_registry.sql @@ -0,0 +1,15 @@ +-- 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. + +ALTER TABLE "Tld" ADD COLUMN default_promo_tokens text[]; diff --git a/db/src/main/resources/sql/schema/nomulus.golden.sql b/db/src/main/resources/sql/schema/nomulus.golden.sql index d904671e1..46aef5ff2 100644 --- a/db/src/main/resources/sql/schema/nomulus.golden.sql +++ b/db/src/main/resources/sql/schema/nomulus.golden.sql @@ -1058,7 +1058,8 @@ CREATE TABLE public."Tld" ( tld_state_transitions public.hstore NOT NULL, tld_type text NOT NULL, tld_unicode text NOT NULL, - transfer_grace_period_length interval NOT NULL + transfer_grace_period_length interval NOT NULL, + default_promo_tokens text[] );