mirror of
https://github.com/google/nomulus
synced 2026-02-06 21:11:34 +00:00
Correctly restore composite VKeys in DomainContent (#825)
* Restore composite vkeys in DomainContent PollMessage/BillingEvent vkeys in DomainContent must have their ofy keys restored from other fields in DomainContent (namely the repo id and their specific history event ids). Add PostLoad methods to DomainContent and DomainHistory to do the restoration. * Fixes for review. * Deal with foreign-key cycles
This commit is contained in:
@@ -249,10 +249,13 @@ create sequence temp_history_id_sequence start 1 increment 50;
|
||||
auth_info_repo_id text,
|
||||
auth_info_value text,
|
||||
billing_recurrence_id int8,
|
||||
billing_recurrence_history_id int8,
|
||||
autorenew_end_time timestamptz,
|
||||
autorenew_poll_message_id int8,
|
||||
autorenew_poll_message_history_id int8,
|
||||
billing_contact text,
|
||||
deletion_poll_message_id int8,
|
||||
deletion_poll_message_history_id int8,
|
||||
domain_name text,
|
||||
idn_table_name text,
|
||||
last_transfer_time timestamptz,
|
||||
@@ -301,10 +304,13 @@ create sequence temp_history_id_sequence start 1 increment 50;
|
||||
auth_info_repo_id text,
|
||||
auth_info_value text,
|
||||
billing_recurrence_id int8,
|
||||
billing_recurrence_history_id int8,
|
||||
autorenew_end_time timestamptz,
|
||||
autorenew_poll_message_id int8,
|
||||
autorenew_poll_message_history_id int8,
|
||||
billing_contact text,
|
||||
deletion_poll_message_id int8,
|
||||
deletion_poll_message_history_id int8,
|
||||
domain_name text,
|
||||
idn_table_name text,
|
||||
last_transfer_time timestamptz,
|
||||
|
||||
@@ -353,7 +353,10 @@ CREATE TABLE public."Domain" (
|
||||
billing_recurrence_id bigint,
|
||||
autorenew_poll_message_id bigint,
|
||||
deletion_poll_message_id bigint,
|
||||
autorenew_end_time timestamp with time zone
|
||||
autorenew_end_time timestamp with time zone,
|
||||
billing_recurrence_history_id bigint,
|
||||
autorenew_poll_message_history_id bigint,
|
||||
deletion_poll_message_history_id bigint
|
||||
);
|
||||
|
||||
|
||||
@@ -420,7 +423,10 @@ CREATE TABLE public."DomainHistory" (
|
||||
autorenew_end_time timestamp with time zone,
|
||||
history_other_registrar_id text,
|
||||
history_period_unit text,
|
||||
history_period_value integer
|
||||
history_period_value integer,
|
||||
billing_recurrence_history_id bigint,
|
||||
autorenew_poll_message_history_id bigint,
|
||||
deletion_poll_message_history_id bigint
|
||||
);
|
||||
|
||||
|
||||
@@ -1768,7 +1774,7 @@ ALTER TABLE ONLY public."Domain"
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public."DomainHistory"
|
||||
ADD CONSTRAINT fk_domain_history_domain_repo_id FOREIGN KEY (domain_repo_id) REFERENCES public."Domain"(repo_id);
|
||||
ADD CONSTRAINT fk_domain_history_domain_repo_id FOREIGN KEY (domain_repo_id) REFERENCES public."Domain"(repo_id) DEFERRABLE INITIALLY DEFERRED;
|
||||
|
||||
|
||||
--
|
||||
@@ -1904,7 +1910,7 @@ ALTER TABLE ONLY public."PollMessage"
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public."PollMessage"
|
||||
ADD CONSTRAINT fk_poll_message_domain_repo_id FOREIGN KEY (domain_repo_id) REFERENCES public."Domain"(repo_id);
|
||||
ADD CONSTRAINT fk_poll_message_domain_repo_id FOREIGN KEY (domain_repo_id) REFERENCES public."Domain"(repo_id) DEFERRABLE INITIALLY DEFERRED;
|
||||
|
||||
|
||||
--
|
||||
|
||||
Reference in New Issue
Block a user