mirror of
https://github.com/google/nomulus.git
synced 2025-08-28 12:03:59 +02:00
Add schema deployment tests (#265)
* Add schema deployment tests Updated flyway schema script files so that they reflect what is currently deployed in alpha: ClaimsList and PremiumList related elements. Put post-schema-push pg_dump output in nomulus.golden.sql as the authoritative schema. Also added test to verify that the schema pushed by flyway will result in exactly the golden schema. Upgraded testcontainers to 1.12.1. Added a custom Truth subject for better diffing of multi-line text blocks. Removed claims_list.sql and premium_list.sql, as we do not have use for them. * Add schema deployment tests Updated flyway schema script files so that they reflect what is currently deployed in alpha: ClaimsList and PremiumList related elements. Put post-schema-push pg_dump output in nomulus.golden.sql as the authoritative schema. Also added test to verify that the schema pushed by flyway will result in exactly the golden schema. Upgraded testcontainers to 1.12.1. Added a custom Truth subject for better diffing of multi-line text blocks. Removed claims_list.sql and premium_list.sql, as we do not have use for them. * Add schema deployment tests Updated flyway schema script files so that they reflect what is currently deployed in alpha: ClaimsList and PremiumList related elements. Put post-schema-push pg_dump output in nomulus.golden.sql as the authoritative schema. Also added test to verify that the schema pushed by flyway will result in exactly the golden schema. Upgraded testcontainers to 1.12.1. Added a custom Truth subject for better diffing of multi-line text blocks. Removed claims_list.sql and premium_list.sql, as we do not have use for them.
This commit is contained in:
parent
40a6b788a0
commit
3fb799f112
14 changed files with 651 additions and 61 deletions
|
@ -25,7 +25,7 @@
|
|||
primary key (revision_id)
|
||||
);
|
||||
|
||||
alter table "ClaimsEntry"
|
||||
alter table if exists "ClaimsEntry"
|
||||
add constraint FKlugn0q07ayrtar87dqi3vs3c8
|
||||
foreign key (revision_id)
|
||||
references "ClaimsList";
|
|
@ -12,16 +12,21 @@
|
|||
-- See the License for the specific language governing permissions and
|
||||
-- limitations under the License.
|
||||
|
||||
CREATE TABLE `ClaimsList` (
|
||||
revision_id BIGSERIAL NOT NULL,
|
||||
creation_timestamp TIMESTAMPTZ NOT NULL,
|
||||
PRIMARY KEY (revision_id)
|
||||
);
|
||||
create table "PremiumEntry" (
|
||||
revision_id int8 not null,
|
||||
price numeric(19, 2) not null,
|
||||
domain_label text not null,
|
||||
primary key (revision_id, domain_label)
|
||||
);
|
||||
|
||||
CREATE TABLE `ClaimsEntry` (
|
||||
revision_id int8 NOT NULL,
|
||||
claim_key TEXT NOT NULL,
|
||||
domain_label TEXT NOT NULL,
|
||||
PRIMARY KEY (revision_id, domain_label),
|
||||
FOREIGN KEY (revision_id) REFERENCES `ClaimsList`(revision_id)
|
||||
);
|
||||
create table "PremiumList" (
|
||||
revision_id bigserial not null,
|
||||
creation_timestamp timestamptz not null,
|
||||
currency bytea not null,
|
||||
primary key (revision_id)
|
||||
);
|
||||
|
||||
alter table if exists "PremiumEntry"
|
||||
add constraint FKqebdja3jkx9c9cnqnrw9g9ocu
|
||||
foreign key (revision_id)
|
||||
references "PremiumList";
|
|
@ -1,18 +1,182 @@
|
|||
--
|
||||
-- PostgreSQL database dump
|
||||
--
|
||||
|
||||
create table "ClaimsEntry" (
|
||||
revision_id int8 not null,
|
||||
claim_key text not null,
|
||||
domain_label text not null,
|
||||
primary key (revision_id, domain_label)
|
||||
);
|
||||
-- Dumped from database version 9.6.12
|
||||
-- Dumped by pg_dump version 9.6.12
|
||||
|
||||
create table "ClaimsList" (
|
||||
revision_id bigserial not null,
|
||||
creation_timestamp timestamptz not null,
|
||||
primary key (revision_id)
|
||||
);
|
||||
SET statement_timeout = 0;
|
||||
SET lock_timeout = 0;
|
||||
SET idle_in_transaction_session_timeout = 0;
|
||||
SET client_encoding = 'UTF8';
|
||||
SET standard_conforming_strings = on;
|
||||
SELECT pg_catalog.set_config('search_path', '', false);
|
||||
SET check_function_bodies = false;
|
||||
SET client_min_messages = warning;
|
||||
SET row_security = off;
|
||||
|
||||
--
|
||||
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -
|
||||
--
|
||||
|
||||
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
|
||||
|
||||
|
||||
--
|
||||
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: -
|
||||
--
|
||||
|
||||
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
|
||||
|
||||
|
||||
SET default_tablespace = '';
|
||||
|
||||
SET default_with_oids = false;
|
||||
|
||||
--
|
||||
-- Name: ClaimsEntry; Type: TABLE; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE TABLE public."ClaimsEntry" (
|
||||
revision_id bigint NOT NULL,
|
||||
claim_key text NOT NULL,
|
||||
domain_label text NOT NULL
|
||||
);
|
||||
|
||||
|
||||
--
|
||||
-- Name: ClaimsList; Type: TABLE; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE TABLE public."ClaimsList" (
|
||||
revision_id bigint NOT NULL,
|
||||
creation_timestamp timestamp with time zone NOT NULL
|
||||
);
|
||||
|
||||
|
||||
--
|
||||
-- Name: ClaimsList_revision_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE SEQUENCE public."ClaimsList_revision_id_seq"
|
||||
START WITH 1
|
||||
INCREMENT BY 1
|
||||
NO MINVALUE
|
||||
NO MAXVALUE
|
||||
CACHE 1;
|
||||
|
||||
|
||||
--
|
||||
-- Name: ClaimsList_revision_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER SEQUENCE public."ClaimsList_revision_id_seq" OWNED BY public."ClaimsList".revision_id;
|
||||
|
||||
|
||||
--
|
||||
-- Name: PremiumEntry; Type: TABLE; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE TABLE public."PremiumEntry" (
|
||||
revision_id bigint NOT NULL,
|
||||
price numeric(19,2) NOT NULL,
|
||||
domain_label text NOT NULL
|
||||
);
|
||||
|
||||
|
||||
--
|
||||
-- Name: PremiumList; Type: TABLE; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE TABLE public."PremiumList" (
|
||||
revision_id bigint NOT NULL,
|
||||
creation_timestamp timestamp with time zone NOT NULL,
|
||||
currency bytea NOT NULL
|
||||
);
|
||||
|
||||
|
||||
--
|
||||
-- Name: PremiumList_revision_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE SEQUENCE public."PremiumList_revision_id_seq"
|
||||
START WITH 1
|
||||
INCREMENT BY 1
|
||||
NO MINVALUE
|
||||
NO MAXVALUE
|
||||
CACHE 1;
|
||||
|
||||
|
||||
--
|
||||
-- Name: PremiumList_revision_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER SEQUENCE public."PremiumList_revision_id_seq" OWNED BY public."PremiumList".revision_id;
|
||||
|
||||
|
||||
--
|
||||
-- Name: ClaimsList revision_id; Type: DEFAULT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public."ClaimsList" ALTER COLUMN revision_id SET DEFAULT nextval('public."ClaimsList_revision_id_seq"'::regclass);
|
||||
|
||||
|
||||
--
|
||||
-- Name: PremiumList revision_id; Type: DEFAULT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public."PremiumList" ALTER COLUMN revision_id SET DEFAULT nextval('public."PremiumList_revision_id_seq"'::regclass);
|
||||
|
||||
|
||||
--
|
||||
-- Name: ClaimsEntry ClaimsEntry_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public."ClaimsEntry"
|
||||
ADD CONSTRAINT "ClaimsEntry_pkey" PRIMARY KEY (revision_id, domain_label);
|
||||
|
||||
|
||||
--
|
||||
-- Name: ClaimsList ClaimsList_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public."ClaimsList"
|
||||
ADD CONSTRAINT "ClaimsList_pkey" PRIMARY KEY (revision_id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: PremiumEntry PremiumEntry_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public."PremiumEntry"
|
||||
ADD CONSTRAINT "PremiumEntry_pkey" PRIMARY KEY (revision_id, domain_label);
|
||||
|
||||
|
||||
--
|
||||
-- Name: PremiumList PremiumList_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public."PremiumList"
|
||||
ADD CONSTRAINT "PremiumList_pkey" PRIMARY KEY (revision_id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: ClaimsEntry fklugn0q07ayrtar87dqi3vs3c8; Type: FK CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public."ClaimsEntry"
|
||||
ADD CONSTRAINT fklugn0q07ayrtar87dqi3vs3c8 FOREIGN KEY (revision_id) REFERENCES public."ClaimsList"(revision_id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: PremiumEntry fkqebdja3jkx9c9cnqnrw9g9ocu; Type: FK CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public."PremiumEntry"
|
||||
ADD CONSTRAINT fkqebdja3jkx9c9cnqnrw9g9ocu FOREIGN KEY (revision_id) REFERENCES public."PremiumList"(revision_id);
|
||||
|
||||
|
||||
--
|
||||
-- PostgreSQL database dump complete
|
||||
--
|
||||
|
||||
alter table "ClaimsEntry"
|
||||
add constraint FKlugn0q07ayrtar87dqi3vs3c8
|
||||
foreign key (revision_id)
|
||||
references "ClaimsList";
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
-- Copyright 2019 The Nomulus Authors. All Rights Reserved.
|
||||
--
|
||||
-- Licensed under the Apache License, Version 2.0 (the "License");
|
||||
-- you may not use this file except in compliance with the License.
|
||||
-- You may obtain a copy of the License at
|
||||
--
|
||||
-- http://www.apache.org/licenses/LICENSE-2.0
|
||||
--
|
||||
-- Unless required by applicable law or agreed to in writing, software
|
||||
-- distributed under the License is distributed on an "AS IS" BASIS,
|
||||
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
-- See the License for the specific language governing permissions and
|
||||
-- limitations under the License.
|
||||
|
||||
CREATE TABLE "PremiumList" (
|
||||
revision_id BIGSERIAL NOT NULL,
|
||||
creation_timestamp TIMESTAMPTZ NOT NULL,
|
||||
currency TEXT NOT NULL,
|
||||
PRIMARY KEY (revision_id)
|
||||
);
|
||||
|
||||
CREATE TABLE "PremiumEntry" (
|
||||
revision_id BIGSERIAL NOT NULL,
|
||||
price NUMERIC(12, 2) NOT NULL,
|
||||
domain_label TEXT NOT NULL,
|
||||
primary key (revision_id, domain_label),
|
||||
FOREIGN KEY (revision_id) REFERENCES "PremiumList"(revision_id)
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue