Merge pull request #54 from vulcanize/update-schema

Update db schema for latest changes
This commit is contained in:
Rob Mulholand 2019-04-05 16:11:18 -05:00 committed by GitHub
commit 4d0f7ee1bb

View File

@ -70,15 +70,15 @@ CREATE TABLE public.blocks (
id integer NOT NULL, id integer NOT NULL,
difficulty bigint, difficulty bigint,
extra_data character varying, extra_data character varying,
gaslimit bigint, gas_limit bigint,
gasused bigint, gas_used bigint,
hash character varying(66), hash character varying(66),
miner character varying(42), miner character varying(42),
nonce character varying(20), nonce character varying(20),
number bigint, number bigint,
parenthash character varying(66), parent_hash character varying(66),
reward double precision, reward numeric,
uncles_reward double precision, uncles_reward numeric,
size character varying, size character varying,
"time" bigint, "time" bigint,
is_final boolean, is_final boolean,
@ -158,8 +158,8 @@ CREATE TABLE public.eth_nodes (
CREATE TABLE public.full_sync_transactions ( CREATE TABLE public.full_sync_transactions (
id integer NOT NULL, id integer NOT NULL,
block_id integer NOT NULL, block_id integer NOT NULL,
gaslimit numeric, gas_limit numeric,
gasprice numeric, gas_price numeric,
hash character varying(66), hash character varying(66),
input_data bytea, input_data bytea,
nonce numeric, nonce numeric,
@ -233,7 +233,7 @@ CREATE TABLE public.headers (
block_number bigint, block_number bigint,
raw jsonb, raw jsonb,
block_timestamp numeric, block_timestamp numeric,
eth_node_id integer, eth_node_id integer NOT NULL,
eth_node_fingerprint character varying(128) eth_node_fingerprint character varying(128)
); );
@ -266,8 +266,8 @@ CREATE TABLE public.light_sync_transactions (
id integer NOT NULL, id integer NOT NULL,
header_id integer NOT NULL, header_id integer NOT NULL,
hash text, hash text,
gaslimit numeric, gas_limit numeric,
gasprice numeric, gas_price numeric,
input_data bytea, input_data bytea,
nonce numeric, nonce numeric,
raw bytea, raw bytea,
@ -448,6 +448,43 @@ CREATE SEQUENCE public.receipts_id_seq
ALTER SEQUENCE public.receipts_id_seq OWNED BY public.receipts.id; ALTER SEQUENCE public.receipts_id_seq OWNED BY public.receipts.id;
--
-- Name: uncles; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.uncles (
id integer NOT NULL,
hash character varying(66) NOT NULL,
block_id integer NOT NULL,
reward numeric NOT NULL,
miner character varying(42) NOT NULL,
raw jsonb,
block_timestamp numeric,
eth_node_id integer NOT NULL,
eth_node_fingerprint character varying(128)
);
--
-- Name: uncles_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.uncles_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: uncles_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.uncles_id_seq OWNED BY public.uncles.id;
-- --
-- Name: watched_contracts; Type: TABLE; Schema: public; Owner: - -- Name: watched_contracts; Type: TABLE; Schema: public; Owner: -
-- --
@ -579,6 +616,13 @@ ALTER TABLE ONLY public.queued_storage ALTER COLUMN id SET DEFAULT nextval('publ
ALTER TABLE ONLY public.receipts ALTER COLUMN id SET DEFAULT nextval('public.receipts_id_seq'::regclass); ALTER TABLE ONLY public.receipts ALTER COLUMN id SET DEFAULT nextval('public.receipts_id_seq'::regclass);
--
-- Name: uncles id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.uncles ALTER COLUMN id SET DEFAULT nextval('public.uncles_id_seq'::regclass);
-- --
-- Name: watched_contracts contract_id; Type: DEFAULT; Schema: public; Owner: - -- Name: watched_contracts contract_id; Type: DEFAULT; Schema: public; Owner: -
-- --
@ -706,6 +750,22 @@ ALTER TABLE ONLY public.receipts
ADD CONSTRAINT receipts_pkey PRIMARY KEY (id); ADD CONSTRAINT receipts_pkey PRIMARY KEY (id);
--
-- Name: uncles uncles_block_id_hash_key; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.uncles
ADD CONSTRAINT uncles_block_id_hash_key UNIQUE (block_id, hash);
--
-- Name: uncles uncles_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.uncles
ADD CONSTRAINT uncles_pkey PRIMARY KEY (id);
-- --
-- Name: watched_contracts watched_contracts_contract_hash_key; Type: CONSTRAINT; Schema: public; Owner: - -- Name: watched_contracts watched_contracts_contract_hash_key; Type: CONSTRAINT; Schema: public; Owner: -
-- --
@ -780,14 +840,6 @@ ALTER TABLE ONLY public.checked_headers
ADD CONSTRAINT checked_headers_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE; ADD CONSTRAINT checked_headers_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE;
--
-- Name: headers eth_nodes_fk; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.headers
ADD CONSTRAINT eth_nodes_fk FOREIGN KEY (eth_node_id) REFERENCES public.eth_nodes(id) ON DELETE CASCADE;
-- --
-- Name: full_sync_transactions full_sync_transactions_block_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- Name: full_sync_transactions full_sync_transactions_block_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
-- --
@ -796,6 +848,14 @@ ALTER TABLE ONLY public.full_sync_transactions
ADD CONSTRAINT full_sync_transactions_block_id_fkey FOREIGN KEY (block_id) REFERENCES public.blocks(id) ON DELETE CASCADE; ADD CONSTRAINT full_sync_transactions_block_id_fkey FOREIGN KEY (block_id) REFERENCES public.blocks(id) ON DELETE CASCADE;
--
-- Name: headers headers_eth_node_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.headers
ADD CONSTRAINT headers_eth_node_id_fkey FOREIGN KEY (eth_node_id) REFERENCES public.eth_nodes(id) ON DELETE CASCADE;
-- --
-- Name: light_sync_transactions light_sync_transactions_header_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- Name: light_sync_transactions light_sync_transactions_header_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
-- --
@ -820,6 +880,22 @@ ALTER TABLE ONLY public.logs
ADD CONSTRAINT receipts_fk FOREIGN KEY (receipt_id) REFERENCES public.receipts(id) ON DELETE CASCADE; ADD CONSTRAINT receipts_fk FOREIGN KEY (receipt_id) REFERENCES public.receipts(id) ON DELETE CASCADE;
--
-- Name: uncles uncles_block_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.uncles
ADD CONSTRAINT uncles_block_id_fkey FOREIGN KEY (block_id) REFERENCES public.blocks(id) ON DELETE CASCADE;
--
-- Name: uncles uncles_eth_node_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.uncles
ADD CONSTRAINT uncles_eth_node_id_fkey FOREIGN KEY (eth_node_id) REFERENCES public.eth_nodes(id) ON DELETE CASCADE;
-- --
-- PostgreSQL database dump complete -- PostgreSQL database dump complete
-- --