Add a SQL schema to AllocationToken (#763)

* Add a SQL schema to AllocationToken

* Respond to CR

- rename field in tests
- rename allowed_registrar_ids field
- remove unnecessary db load in GATC

* Add TODO for HistoryEntry vkeys

* Run autoformat

* V48 -> V49
This commit is contained in:
gbrodman 2020-08-20 20:18:34 -04:00 committed by GitHub
parent a28632dbe1
commit 5c30ef7086
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 352 additions and 45 deletions

View file

@ -34,6 +34,26 @@ SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: AllocationToken; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public."AllocationToken" (
token text NOT NULL,
update_timestamp timestamp with time zone,
allowed_registrar_ids text[],
allowed_tlds text[],
creation_time timestamp with time zone NOT NULL,
discount_fraction double precision NOT NULL,
discount_premiums boolean NOT NULL,
discount_years integer NOT NULL,
domain_name text,
redemption_history_entry text,
token_status_transitions public.hstore,
token_type text
);
--
-- Name: BillingCancellation; Type: TABLE; Schema: public; Owner: -
--
@ -985,6 +1005,14 @@ ALTER TABLE ONLY public."Spec11ThreatMatch" ALTER COLUMN id SET DEFAULT nextval(
ALTER TABLE ONLY public."Transaction" ALTER COLUMN id SET DEFAULT nextval('public."Transaction_id_seq"'::regclass);
--
-- Name: AllocationToken AllocationToken_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public."AllocationToken"
ADD CONSTRAINT "AllocationToken_pkey" PRIMARY KEY (token);
--
-- Name: BillingCancellation BillingCancellation_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
@ -1185,6 +1213,13 @@ ALTER TABLE ONLY public."RegistryLock"
ADD CONSTRAINT idx_registry_lock_repo_id_revision_id UNIQUE (repo_id, revision_id);
--
-- Name: allocation_token_domain_name_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX allocation_token_domain_name_idx ON public."AllocationToken" USING btree (domain_name);
--
-- Name: idx1iy7njgb7wjmj9piml4l2g0qi; Type: INDEX; Schema: public; Owner: -
--