Add SQL schema for GracePeriodHistory (#746)

* Add schema for GracePeriodHistory

Rebase on HEAD

Rebase on HEAD

Rebase on HEAD and rename column

Use OfyService to generate id

Refactor GracePeriodsSubject

Rebase on HEAD

Remove GracePeriodSubject and GracePeriodsSubject

Rebase on HEAD

Rebase on HEAD

Rebase on HEAD

Add gracePeriodHistoryRevisionId and remove some foreign key

* Rebase on HEAD
This commit is contained in:
Shicong Huang 2020-11-12 10:06:58 -05:00 committed by GitHub
parent 1349fa4cfc
commit 8625e44cfd
23 changed files with 4813 additions and 4091 deletions

View file

@ -524,7 +524,7 @@ ALTER SEQUENCE public."DomainTransactionRecord_id_seq" OWNED BY public."DomainTr
--
CREATE TABLE public."GracePeriod" (
id bigint NOT NULL,
grace_period_id bigint NOT NULL,
billing_event_id bigint,
billing_recurrence_id bigint,
registrar_id text NOT NULL,
@ -536,6 +536,25 @@ CREATE TABLE public."GracePeriod" (
);
--
-- Name: GracePeriodHistory; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public."GracePeriodHistory" (
grace_period_history_revision_id bigint NOT NULL,
billing_event_id bigint,
billing_event_history_id bigint,
billing_recurrence_id bigint,
billing_recurrence_history_id bigint,
registrar_id text NOT NULL,
domain_repo_id text NOT NULL,
expiration_time timestamp with time zone NOT NULL,
type text NOT NULL,
domain_history_revision_id bigint,
grace_period_id bigint NOT NULL
);
--
-- Name: Host; Type: TABLE; Schema: public; Owner: -
--
@ -1212,12 +1231,20 @@ ALTER TABLE ONLY public."Domain"
ADD CONSTRAINT "Domain_pkey" PRIMARY KEY (repo_id);
--
-- Name: GracePeriodHistory GracePeriodHistory_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public."GracePeriodHistory"
ADD CONSTRAINT "GracePeriodHistory_pkey" PRIMARY KEY (grace_period_history_revision_id);
--
-- Name: GracePeriod GracePeriod_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public."GracePeriod"
ADD CONSTRAINT "GracePeriod_pkey" PRIMARY KEY (id);
ADD CONSTRAINT "GracePeriod_pkey" PRIMARY KEY (grace_period_id);
--
@ -1536,6 +1563,13 @@ CREATE INDEX idxaydgox62uno9qx8cjlj5lauye ON public."PollMessage" USING btree (e
CREATE INDEX idxbn8t4wp85fgxjl8q4ctlscx55 ON public."Contact" USING btree (current_sponsor_registrar_id);
--
-- Name: idxd01j17vrpjxaerxdmn8bwxs7s; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX idxd01j17vrpjxaerxdmn8bwxs7s ON public."GracePeriodHistory" USING btree (domain_repo_id);
--
-- Name: idxe7wu46c7wpvfmfnj4565abibp; Type: INDEX; Schema: public; Owner: -
--
@ -1816,6 +1850,14 @@ ALTER TABLE ONLY public."ClaimsEntry"
ADD CONSTRAINT fk6sc6at5hedffc0nhdcab6ivuq FOREIGN KEY (revision_id) REFERENCES public."ClaimsList"(revision_id);
--
-- Name: GracePeriodHistory fk7w3cx8d55q8bln80e716tr7b8; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public."GracePeriodHistory"
ADD CONSTRAINT fk7w3cx8d55q8bln80e716tr7b8 FOREIGN KEY (domain_repo_id, domain_history_revision_id) REFERENCES public."DomainHistory"(domain_repo_id, history_revision_id);
--
-- Name: Contact fk93c185fx7chn68uv7nl6uv2s0; Type: FK CONSTRAINT; Schema: public; Owner: -
--