forked from cerc-io/ipld-eth-server
Add Pit file debt ceiling event
This commit is contained in:
@@ -1,2 +1,3 @@
|
||||
DROP TABLE maker.pit_file_ilk;
|
||||
DROP TABLE maker.pit_file_stability_fee;
|
||||
DROP TABLE maker.pit_file_stability_fee;
|
||||
DROP TABLE maker.pit_file_debt_ceiling;
|
||||
@@ -17,4 +17,14 @@ CREATE TABLE maker.pit_file_stability_fee (
|
||||
tx_idx INTEGER NOT NULL,
|
||||
raw_log JSONB,
|
||||
UNIQUE (header_id, tx_idx)
|
||||
)
|
||||
);
|
||||
|
||||
CREATE TABLE maker.pit_file_debt_ceiling (
|
||||
id SERIAL PRIMARY KEY,
|
||||
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
|
||||
what TEXT,
|
||||
data NUMERIC,
|
||||
tx_idx INTEGER NOT NULL,
|
||||
raw_log JSONB,
|
||||
UNIQUE (header_id, tx_idx)
|
||||
);
|
||||
@@ -156,6 +156,40 @@ CREATE SEQUENCE maker.frob_id_seq
|
||||
ALTER SEQUENCE maker.frob_id_seq OWNED BY maker.frob.id;
|
||||
|
||||
|
||||
--
|
||||
-- Name: pit_file_debt_ceiling; Type: TABLE; Schema: maker; Owner: -
|
||||
--
|
||||
|
||||
CREATE TABLE maker.pit_file_debt_ceiling (
|
||||
id integer NOT NULL,
|
||||
header_id integer NOT NULL,
|
||||
what text,
|
||||
data numeric,
|
||||
tx_idx integer NOT NULL,
|
||||
raw_log jsonb
|
||||
);
|
||||
|
||||
|
||||
--
|
||||
-- Name: pit_file_debt_ceiling_id_seq; Type: SEQUENCE; Schema: maker; Owner: -
|
||||
--
|
||||
|
||||
CREATE SEQUENCE maker.pit_file_debt_ceiling_id_seq
|
||||
AS integer
|
||||
START WITH 1
|
||||
INCREMENT BY 1
|
||||
NO MINVALUE
|
||||
NO MAXVALUE
|
||||
CACHE 1;
|
||||
|
||||
|
||||
--
|
||||
-- Name: pit_file_debt_ceiling_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: -
|
||||
--
|
||||
|
||||
ALTER SEQUENCE maker.pit_file_debt_ceiling_id_seq OWNED BY maker.pit_file_debt_ceiling.id;
|
||||
|
||||
|
||||
--
|
||||
-- Name: pit_file_ilk; Type: TABLE; Schema: maker; Owner: -
|
||||
--
|
||||
@@ -689,6 +723,13 @@ ALTER TABLE ONLY maker.flip_kick ALTER COLUMN db_id SET DEFAULT nextval('maker.f
|
||||
ALTER TABLE ONLY maker.frob ALTER COLUMN id SET DEFAULT nextval('maker.frob_id_seq'::regclass);
|
||||
|
||||
|
||||
--
|
||||
-- Name: pit_file_debt_ceiling id; Type: DEFAULT; Schema: maker; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY maker.pit_file_debt_ceiling ALTER COLUMN id SET DEFAULT nextval('maker.pit_file_debt_ceiling_id_seq'::regclass);
|
||||
|
||||
|
||||
--
|
||||
-- Name: pit_file_ilk id; Type: DEFAULT; Schema: maker; Owner: -
|
||||
--
|
||||
@@ -828,6 +869,22 @@ ALTER TABLE ONLY maker.frob
|
||||
ADD CONSTRAINT frob_pkey PRIMARY KEY (id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: pit_file_debt_ceiling pit_file_debt_ceiling_header_id_tx_idx_key; Type: CONSTRAINT; Schema: maker; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY maker.pit_file_debt_ceiling
|
||||
ADD CONSTRAINT pit_file_debt_ceiling_header_id_tx_idx_key UNIQUE (header_id, tx_idx);
|
||||
|
||||
|
||||
--
|
||||
-- Name: pit_file_debt_ceiling pit_file_debt_ceiling_pkey; Type: CONSTRAINT; Schema: maker; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY maker.pit_file_debt_ceiling
|
||||
ADD CONSTRAINT pit_file_debt_ceiling_pkey PRIMARY KEY (id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: pit_file_ilk pit_file_ilk_header_id_tx_idx_key; Type: CONSTRAINT; Schema: maker; Owner: -
|
||||
--
|
||||
@@ -1055,6 +1112,14 @@ ALTER TABLE ONLY maker.price_feeds
|
||||
ADD CONSTRAINT headers_fk FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE;
|
||||
|
||||
|
||||
--
|
||||
-- Name: pit_file_debt_ceiling pit_file_debt_ceiling_header_id_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY maker.pit_file_debt_ceiling
|
||||
ADD CONSTRAINT pit_file_debt_ceiling_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE;
|
||||
|
||||
|
||||
--
|
||||
-- Name: pit_file_ilk pit_file_ilk_header_id_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: -
|
||||
--
|
||||
|
||||
Reference in New Issue
Block a user