mirror of
https://github.com/google/nomulus.git
synced 2025-08-12 04:29:39 +02:00
Refactor DomainBase into DomainContent and create DomainHistory (#668)
* Refactor DomainBase into DomainContent and create DomainHistory This is similar to #587 and #634, but for domains. One caveat is that we refactor some of the Domain* instance methods to be static so that they can be called either on DomainBase or DomainContent, returning the appropriate type each time. Note that we set DomainHistory to use the same revision ID sequence as HostHistory and ContactHistory. In addition, we refactor the tests to the History objects a bit to reduce duplicate code and because we cannot guarantee yet that the SQL-stored VKeys are symmetrical -- the ofy keys are not persisted at the moment. In addition, rename the DomainHost table to the default Domain_nsHosts so that it automatically creates two separate nsHosts tables for us -- one foreign-keyed on the domain repo ID, and one foreign-keyed on the history revision ID * Use access hackery to allow manual names for nsHosts tables * Clean up post merge artifacts * Add unused setters that Hibernate requires * Fix the tests and semantic merge conflicts * Change ns_hosts to ns_host everywhere * Rename ns_host to host_repo_id * V42 -> V44
This commit is contained in:
parent
9304e2f421
commit
d8ec6294c3
14 changed files with 1393 additions and 800 deletions
|
@ -405,13 +405,86 @@ CREATE TABLE public."Domain" (
|
|||
);
|
||||
|
||||
|
||||
--
|
||||
-- Name: DomainHistory; Type: TABLE; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE TABLE public."DomainHistory" (
|
||||
history_revision_id bigint DEFAULT nextval('public.history_id_sequence'::regclass) NOT NULL,
|
||||
history_by_superuser boolean NOT NULL,
|
||||
history_registrar_id text,
|
||||
history_modification_time timestamp with time zone NOT NULL,
|
||||
history_reason text NOT NULL,
|
||||
history_requested_by_registrar boolean NOT NULL,
|
||||
history_client_transaction_id text,
|
||||
history_server_transaction_id text,
|
||||
history_type text NOT NULL,
|
||||
history_xml_bytes bytea NOT NULL,
|
||||
admin_contact text,
|
||||
auth_info_repo_id text,
|
||||
auth_info_value text,
|
||||
billing_recurrence_id bigint,
|
||||
autorenew_poll_message_id bigint,
|
||||
billing_contact text,
|
||||
deletion_poll_message_id bigint,
|
||||
domain_name text,
|
||||
idn_table_name text,
|
||||
last_transfer_time timestamp with time zone,
|
||||
launch_notice_accepted_time timestamp with time zone,
|
||||
launch_notice_expiration_time timestamp with time zone,
|
||||
launch_notice_tcn_id text,
|
||||
launch_notice_validator_id text,
|
||||
registrant_contact text,
|
||||
registration_expiration_time timestamp with time zone,
|
||||
smd_id text,
|
||||
subordinate_hosts text[],
|
||||
tech_contact text,
|
||||
tld text,
|
||||
transfer_billing_cancellation_id bigint,
|
||||
transfer_billing_recurrence_id bigint,
|
||||
transfer_autorenew_poll_message_id bigint,
|
||||
transfer_billing_event_id bigint,
|
||||
transfer_renew_period_unit text,
|
||||
transfer_renew_period_value integer,
|
||||
transfer_registration_expiration_time timestamp with time zone,
|
||||
transfer_gaining_poll_message_id bigint,
|
||||
transfer_losing_poll_message_id bigint,
|
||||
transfer_client_txn_id text,
|
||||
transfer_server_txn_id text,
|
||||
transfer_gaining_registrar_id text,
|
||||
transfer_losing_registrar_id text,
|
||||
transfer_pending_expiration_time timestamp with time zone,
|
||||
transfer_request_time timestamp with time zone,
|
||||
transfer_status text,
|
||||
creation_registrar_id text NOT NULL,
|
||||
creation_time timestamp with time zone NOT NULL,
|
||||
current_sponsor_registrar_id text NOT NULL,
|
||||
deletion_time timestamp with time zone,
|
||||
last_epp_update_registrar_id text,
|
||||
last_epp_update_time timestamp with time zone,
|
||||
statuses text[],
|
||||
update_timestamp timestamp with time zone,
|
||||
domain_repo_id text NOT NULL
|
||||
);
|
||||
|
||||
|
||||
--
|
||||
-- Name: DomainHistoryHost; Type: TABLE; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE TABLE public."DomainHistoryHost" (
|
||||
domain_history_history_revision_id bigint NOT NULL,
|
||||
host_repo_id text
|
||||
);
|
||||
|
||||
|
||||
--
|
||||
-- Name: DomainHost; Type: TABLE; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE TABLE public."DomainHost" (
|
||||
domain_repo_id text NOT NULL,
|
||||
ns_hosts text
|
||||
host_repo_id text
|
||||
);
|
||||
|
||||
|
||||
|
@ -933,6 +1006,14 @@ ALTER TABLE ONLY public."Cursor"
|
|||
ADD CONSTRAINT "Cursor_pkey" PRIMARY KEY (scope, type);
|
||||
|
||||
|
||||
--
|
||||
-- Name: DomainHistory DomainHistory_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public."DomainHistory"
|
||||
ADD CONSTRAINT "DomainHistory_pkey" PRIMARY KEY (history_revision_id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: Domain Domain_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
|
@ -1131,6 +1212,13 @@ CREATE INDEX idx6py6ocrab0ivr76srcd2okpnq ON public."BillingEvent" USING btree (
|
|||
CREATE INDEX idx6syykou4nkc7hqa5p8r92cpch ON public."BillingRecurrence" USING btree (event_time);
|
||||
|
||||
|
||||
--
|
||||
-- Name: idx6w3qbtgce93cal2orjg1tw7b7; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE INDEX idx6w3qbtgce93cal2orjg1tw7b7 ON public."DomainHistory" USING btree (history_modification_time);
|
||||
|
||||
|
||||
--
|
||||
-- Name: idx73l103vc5900ig3p4odf0cngt; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
|
@ -1166,6 +1254,13 @@ CREATE INDEX idx_registry_lock_registrar_id ON public."RegistryLock" USING btree
|
|||
CREATE INDEX idx_registry_lock_verification_code ON public."RegistryLock" USING btree (verification_code);
|
||||
|
||||
|
||||
--
|
||||
-- Name: idxaro1omfuaxjwmotk3vo00trwm; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE INDEX idxaro1omfuaxjwmotk3vo00trwm ON public."DomainHistory" USING btree (history_registrar_id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: idxaydgox62uno9qx8cjlj5lauye; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
|
@ -1285,6 +1380,13 @@ CREATE INDEX idxplxf9v56p0wg8ws6qsvd082hk ON public."BillingEvent" USING btree (
|
|||
CREATE INDEX idxqa3g92jc17e8dtiaviy4fet4x ON public."BillingCancellation" USING btree (billing_time);
|
||||
|
||||
|
||||
--
|
||||
-- Name: idxrh4xmrot9bd63o382ow9ltfig; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE INDEX idxrh4xmrot9bd63o382ow9ltfig ON public."DomainHistory" USING btree (creation_time);
|
||||
|
||||
|
||||
--
|
||||
-- Name: idxrwl38wwkli1j7gkvtywi9jokq; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
|
@ -1292,6 +1394,13 @@ CREATE INDEX idxqa3g92jc17e8dtiaviy4fet4x ON public."BillingCancellation" USING
|
|||
CREATE INDEX idxrwl38wwkli1j7gkvtywi9jokq ON public."Domain" USING btree (tld);
|
||||
|
||||
|
||||
--
|
||||
-- Name: idxsu1nam10cjes9keobapn5jvxj; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE INDEX idxsu1nam10cjes9keobapn5jvxj ON public."DomainHistory" USING btree (history_type);
|
||||
|
||||
|
||||
--
|
||||
-- Name: idxsudwswtwqnfnx2o1hx4s0k0g5; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
|
@ -1395,6 +1504,14 @@ ALTER TABLE ONLY public."HostHistory"
|
|||
ADD CONSTRAINT fk3d09knnmxrt6iniwnp8j2ykga FOREIGN KEY (history_registrar_id) REFERENCES public."Registrar"(registrar_id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: DomainHistoryHost fk6b8eqdxwe3guc56tgpm89atx; Type: FK CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public."DomainHistoryHost"
|
||||
ADD CONSTRAINT fk6b8eqdxwe3guc56tgpm89atx FOREIGN KEY (domain_history_history_revision_id) REFERENCES public."DomainHistory"(history_revision_id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: ClaimsEntry fk6sc6at5hedffc0nhdcab6ivuq; Type: FK CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
|
@ -1531,6 +1648,22 @@ ALTER TABLE ONLY public."Domain"
|
|||
ADD CONSTRAINT fk_domain_deletion_poll_message_id FOREIGN KEY (deletion_poll_message_id) REFERENCES public."PollMessage"(poll_message_id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: DomainHistory fk_domain_history_domain_repo_id; Type: FK CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public."DomainHistory"
|
||||
ADD CONSTRAINT fk_domain_history_domain_repo_id FOREIGN KEY (domain_repo_id) REFERENCES public."Domain"(repo_id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: DomainHistory fk_domain_history_registrar_id; Type: FK CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public."DomainHistory"
|
||||
ADD CONSTRAINT fk_domain_history_registrar_id FOREIGN KEY (history_registrar_id) REFERENCES public."Registrar"(registrar_id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: Domain fk_domain_registrant_contact; Type: FK CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
|
@ -1592,7 +1725,7 @@ ALTER TABLE ONLY public."Domain"
|
|||
--
|
||||
|
||||
ALTER TABLE ONLY public."DomainHost"
|
||||
ADD CONSTRAINT fk_domainhost_host_valid FOREIGN KEY (ns_hosts) REFERENCES public."HostResource"(repo_id);
|
||||
ADD CONSTRAINT fk_domainhost_host_valid FOREIGN KEY (host_repo_id) REFERENCES public."HostResource"(repo_id);
|
||||
|
||||
|
||||
--
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue