forked from cerc-io/ipld-eth-server
Deal transformer (#19)
This commit is contained in:
@@ -0,0 +1 @@
|
||||
DROP TABLE maker.deal;
|
||||
@@ -0,0 +1,8 @@
|
||||
CREATE TABLE maker.deal (
|
||||
id SERIAL PRIMARY KEY,
|
||||
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
|
||||
bid_id NUMERIC NOT NULL,
|
||||
tx_idx INTEGER NOT NUll,
|
||||
raw_log JSONB,
|
||||
UNIQUE (header_id, tx_idx)
|
||||
);
|
||||
@@ -79,6 +79,39 @@ CREATE SEQUENCE maker.bite_id_seq
|
||||
ALTER SEQUENCE maker.bite_id_seq OWNED BY maker.bite.id;
|
||||
|
||||
|
||||
--
|
||||
-- Name: deal; Type: TABLE; Schema: maker; Owner: -
|
||||
--
|
||||
|
||||
CREATE TABLE maker.deal (
|
||||
id integer NOT NULL,
|
||||
header_id integer NOT NULL,
|
||||
bid_id numeric NOT NULL,
|
||||
tx_idx integer NOT NULL,
|
||||
raw_log jsonb
|
||||
);
|
||||
|
||||
|
||||
--
|
||||
-- Name: deal_id_seq; Type: SEQUENCE; Schema: maker; Owner: -
|
||||
--
|
||||
|
||||
CREATE SEQUENCE maker.deal_id_seq
|
||||
AS integer
|
||||
START WITH 1
|
||||
INCREMENT BY 1
|
||||
NO MINVALUE
|
||||
NO MAXVALUE
|
||||
CACHE 1;
|
||||
|
||||
|
||||
--
|
||||
-- Name: deal_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: -
|
||||
--
|
||||
|
||||
ALTER SEQUENCE maker.deal_id_seq OWNED BY maker.deal.id;
|
||||
|
||||
|
||||
--
|
||||
-- Name: dent; Type: TABLE; Schema: maker; Owner: -
|
||||
--
|
||||
@@ -884,6 +917,13 @@ CREATE VIEW public.watched_event_logs AS
|
||||
ALTER TABLE ONLY maker.bite ALTER COLUMN id SET DEFAULT nextval('maker.bite_id_seq'::regclass);
|
||||
|
||||
|
||||
--
|
||||
-- Name: deal id; Type: DEFAULT; Schema: maker; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY maker.deal ALTER COLUMN id SET DEFAULT nextval('maker.deal_id_seq'::regclass);
|
||||
|
||||
|
||||
--
|
||||
-- Name: dent db_id; Type: DEFAULT; Schema: maker; Owner: -
|
||||
--
|
||||
@@ -1047,6 +1087,22 @@ ALTER TABLE ONLY maker.bite
|
||||
ADD CONSTRAINT bite_pkey PRIMARY KEY (id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: deal deal_header_id_tx_idx_key; Type: CONSTRAINT; Schema: maker; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY maker.deal
|
||||
ADD CONSTRAINT deal_header_id_tx_idx_key UNIQUE (header_id, tx_idx);
|
||||
|
||||
|
||||
--
|
||||
-- Name: deal deal_pkey; Type: CONSTRAINT; Schema: maker; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY maker.deal
|
||||
ADD CONSTRAINT deal_pkey PRIMARY KEY (id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: dent dent_bid_id_key; Type: CONSTRAINT; Schema: maker; Owner: -
|
||||
--
|
||||
@@ -1378,6 +1434,14 @@ ALTER TABLE ONLY maker.bite
|
||||
ADD CONSTRAINT bite_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE;
|
||||
|
||||
|
||||
--
|
||||
-- Name: deal deal_header_id_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY maker.deal
|
||||
ADD CONSTRAINT deal_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE;
|
||||
|
||||
|
||||
--
|
||||
-- Name: dent dent_header_id_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: -
|
||||
--
|
||||
|
||||
Reference in New Issue
Block a user