Vat.fold: add migrations

This commit is contained in:
David Terry 2018-10-03 12:44:23 +02:00
parent 377c57ce1b
commit 2feb7ea546
3 changed files with 86 additions and 3 deletions

View File

@ -0,0 +1,3 @@
DROP TABLE maker.flop_kick;
ALTER TABLE public.checked_headers
DROP COLUMN flop_kick_checked;

View File

@ -0,0 +1,13 @@
CREATE TABLE maker.vat_fold (
id SERIAL PRIMARY KEY,
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
ilk bytea,
urn bytea,
rate numeric,
tx_idx INTEGER NOT NULL,
raw_log JSONB,
UNIQUE (header_id, tx_idx)
);
ALTER TABLE public.checked_headers
ADD COLUMN vat_fold_checked BOOLEAN NOT NULL DEFAULT FALSE;

View File

@ -2,8 +2,8 @@
-- PostgreSQL database dump
--
-- Dumped from database version 10.3
-- Dumped by pg_dump version 10.3
-- Dumped from database version 10.5
-- Dumped by pg_dump version 10.5
SET statement_timeout = 0;
SET lock_timeout = 0;
@ -697,6 +697,41 @@ CREATE SEQUENCE maker.tend_id_seq
ALTER SEQUENCE maker.tend_id_seq OWNED BY maker.tend.id;
--
-- Name: vat_fold; Type: TABLE; Schema: maker; Owner: -
--
CREATE TABLE maker.vat_fold (
id integer NOT NULL,
header_id integer NOT NULL,
ilk bytea,
urn bytea,
rate numeric,
tx_idx integer NOT NULL,
raw_log jsonb
);
--
-- Name: vat_fold_id_seq; Type: SEQUENCE; Schema: maker; Owner: -
--
CREATE SEQUENCE maker.vat_fold_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: vat_fold_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: -
--
ALTER SEQUENCE maker.vat_fold_id_seq OWNED BY maker.vat_fold.id;
--
-- Name: vat_init; Type: TABLE; Schema: maker; Owner: -
--
@ -820,7 +855,8 @@ CREATE TABLE public.checked_headers (
tend_checked boolean DEFAULT false NOT NULL,
cat_file_chop_lump_checked boolean DEFAULT false NOT NULL,
cat_file_flip_checked boolean DEFAULT false NOT NULL,
cat_file_pit_vow_checked boolean DEFAULT false NOT NULL
cat_file_pit_vow_checked boolean DEFAULT false NOT NULL,
vat_fold_checked boolean DEFAULT false NOT NULL
);
@ -1267,6 +1303,13 @@ ALTER TABLE ONLY maker.price_feeds ALTER COLUMN id SET DEFAULT nextval('maker.pr
ALTER TABLE ONLY maker.tend ALTER COLUMN id SET DEFAULT nextval('maker.tend_id_seq'::regclass);
--
-- Name: vat_fold id; Type: DEFAULT; Schema: maker; Owner: -
--
ALTER TABLE ONLY maker.vat_fold ALTER COLUMN id SET DEFAULT nextval('maker.vat_fold_id_seq'::regclass);
--
-- Name: vat_init id; Type: DEFAULT; Schema: maker; Owner: -
--
@ -1648,6 +1691,22 @@ ALTER TABLE ONLY maker.tend
ADD CONSTRAINT tend_pkey PRIMARY KEY (id);
--
-- Name: vat_fold vat_fold_header_id_tx_idx_key; Type: CONSTRAINT; Schema: maker; Owner: -
--
ALTER TABLE ONLY maker.vat_fold
ADD CONSTRAINT vat_fold_header_id_tx_idx_key UNIQUE (header_id, tx_idx);
--
-- Name: vat_fold vat_fold_pkey; Type: CONSTRAINT; Schema: maker; Owner: -
--
ALTER TABLE ONLY maker.vat_fold
ADD CONSTRAINT vat_fold_pkey PRIMARY KEY (id);
--
-- Name: vat_init vat_init_header_id_tx_idx_key; Type: CONSTRAINT; Schema: maker; Owner: -
--
@ -1962,6 +2021,14 @@ ALTER TABLE ONLY maker.tend
ADD CONSTRAINT tend_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE;
--
-- Name: vat_fold vat_fold_header_id_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: -
--
ALTER TABLE ONLY maker.vat_fold
ADD CONSTRAINT vat_fold_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE;
--
-- Name: vat_init vat_init_header_id_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: -
--