Change primary key of DelegationSignerData and add its history table (#841)

* Change primary key of DelegationSignerData and add its history table

* Change primary key and resolve comments

* Rebase on HEAD
This commit is contained in:
Shicong Huang 2020-10-29 16:19:15 -04:00 committed by GitHub
parent 2000ea2d60
commit b8d913ef64
14 changed files with 4405 additions and 3505 deletions

View file

@ -376,6 +376,21 @@ CREATE TABLE public."Domain" (
);
--
-- Name: DomainDsDataHistory; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public."DomainDsDataHistory" (
ds_data_history_revision_id bigint NOT NULL,
algorithm integer NOT NULL,
digest bytea NOT NULL,
digest_type integer NOT NULL,
domain_history_revision_id bigint NOT NULL,
key_tag integer NOT NULL,
domain_repo_id text
);
--
-- Name: DomainHistory; Type: TABLE; Schema: public; Owner: -
--
@ -1072,7 +1087,15 @@ ALTER TABLE ONLY public."Cursor"
--
ALTER TABLE ONLY public."DelegationSignerData"
ADD CONSTRAINT "DelegationSignerData_pkey" PRIMARY KEY (domain_repo_id, key_tag);
ADD CONSTRAINT "DelegationSignerData_pkey" PRIMARY KEY (domain_repo_id, key_tag, algorithm, digest_type, digest);
--
-- Name: DomainDsDataHistory DomainDsDataHistory_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public."DomainDsDataHistory"
ADD CONSTRAINT "DomainDsDataHistory_pkey" PRIMARY KEY (ds_data_history_revision_id);
--
@ -2016,6 +2039,14 @@ ALTER TABLE ONLY public."PremiumEntry"
ADD CONSTRAINT fko0gw90lpo1tuee56l0nb6y6g5 FOREIGN KEY (revision_id) REFERENCES public."PremiumList"(revision_id);
--
-- Name: DomainDsDataHistory fko4ilgyyfnvppbpuivus565i0j; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public."DomainDsDataHistory"
ADD CONSTRAINT fko4ilgyyfnvppbpuivus565i0j FOREIGN KEY (domain_repo_id, domain_history_revision_id) REFERENCES public."DomainHistory"(domain_repo_id, history_revision_id);
--
-- Name: DelegationSignerData fktr24j9v14ph2mfuw2gsmt12kq; Type: FK CONSTRAINT; Schema: public; Owner: -
--