migration for vat flux

This commit is contained in:
Taka Goto 2018-10-11 12:16:10 -05:00
parent d0226dbce5
commit 4d99e8a324
3 changed files with 86 additions and 1 deletions

View File

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

View File

@ -0,0 +1,14 @@
CREATE TABLE maker.vat_flux (
id SERIAL PRIMARY KEY,
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
ilk TEXT,
src TEXT,
dst TEXT,
rad numeric,
tx_idx INTEGER NOT NULL,
raw_log JSONB,
UNIQUE (header_id, tx_idx)
);
ALTER TABLE public.checked_headers
ADD COLUMN vat_flux_checked BOOLEAN NOT NULL DEFAULT FALSE;

View File

@ -697,6 +697,42 @@ CREATE SEQUENCE maker.tend_id_seq
ALTER SEQUENCE maker.tend_id_seq OWNED BY maker.tend.id; ALTER SEQUENCE maker.tend_id_seq OWNED BY maker.tend.id;
--
-- Name: vat_flux; Type: TABLE; Schema: maker; Owner: -
--
CREATE TABLE maker.vat_flux (
id integer NOT NULL,
header_id integer NOT NULL,
ilk text,
src text,
dst text,
rad numeric,
tx_idx integer NOT NULL,
raw_log jsonb
);
--
-- Name: vat_flux_id_seq; Type: SEQUENCE; Schema: maker; Owner: -
--
CREATE SEQUENCE maker.vat_flux_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: vat_flux_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: -
--
ALTER SEQUENCE maker.vat_flux_id_seq OWNED BY maker.vat_flux.id;
-- --
-- Name: vat_fold; Type: TABLE; Schema: maker; Owner: - -- Name: vat_fold; Type: TABLE; Schema: maker; Owner: -
-- --
@ -1052,7 +1088,8 @@ CREATE TABLE public.checked_headers (
vat_heal_checked boolean DEFAULT false NOT NULL, vat_heal_checked boolean DEFAULT false NOT NULL,
vat_toll_checked boolean DEFAULT false NOT NULL, vat_toll_checked boolean DEFAULT false NOT NULL,
vat_tune_checked boolean DEFAULT false NOT NULL, vat_tune_checked boolean DEFAULT false NOT NULL,
vat_grab_checked boolean DEFAULT false NOT NULL vat_grab_checked boolean DEFAULT false NOT NULL,
vat_flux_checked boolean DEFAULT false NOT NULL
); );
@ -1500,6 +1537,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); ALTER TABLE ONLY maker.tend ALTER COLUMN id SET DEFAULT nextval('maker.tend_id_seq'::regclass);
--
-- Name: vat_flux id; Type: DEFAULT; Schema: maker; Owner: -
--
ALTER TABLE ONLY maker.vat_flux ALTER COLUMN id SET DEFAULT nextval('maker.vat_flux_id_seq'::regclass);
-- --
-- Name: vat_fold id; Type: DEFAULT; Schema: maker; Owner: - -- Name: vat_fold id; Type: DEFAULT; Schema: maker; Owner: -
-- --
@ -1907,6 +1951,22 @@ ALTER TABLE ONLY maker.tend
ADD CONSTRAINT tend_pkey PRIMARY KEY (id); ADD CONSTRAINT tend_pkey PRIMARY KEY (id);
--
-- Name: vat_flux vat_flux_header_id_tx_idx_key; Type: CONSTRAINT; Schema: maker; Owner: -
--
ALTER TABLE ONLY maker.vat_flux
ADD CONSTRAINT vat_flux_header_id_tx_idx_key UNIQUE (header_id, tx_idx);
--
-- Name: vat_flux vat_flux_pkey; Type: CONSTRAINT; Schema: maker; Owner: -
--
ALTER TABLE ONLY maker.vat_flux
ADD CONSTRAINT vat_flux_pkey PRIMARY KEY (id);
-- --
-- Name: vat_fold vat_fold_header_id_tx_idx_key; Type: CONSTRAINT; Schema: maker; Owner: - -- Name: vat_fold vat_fold_header_id_tx_idx_key; Type: CONSTRAINT; Schema: maker; Owner: -
-- --
@ -2317,6 +2377,14 @@ ALTER TABLE ONLY maker.tend
ADD CONSTRAINT tend_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE; ADD CONSTRAINT tend_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE;
--
-- Name: vat_flux vat_flux_header_id_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: -
--
ALTER TABLE ONLY maker.vat_flux
ADD CONSTRAINT vat_flux_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: - -- Name: vat_fold vat_fold_header_id_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: -
-- --