2018-01-16 15:11:23 +00:00
|
|
|
--
|
|
|
|
-- PostgreSQL database dump
|
|
|
|
--
|
|
|
|
|
2019-03-21 19:52:24 +00:00
|
|
|
-- Dumped from database version 10.5
|
|
|
|
-- Dumped by pg_dump version 10.4
|
2018-01-16 15:11:23 +00:00
|
|
|
|
|
|
|
SET statement_timeout = 0;
|
|
|
|
SET lock_timeout = 0;
|
|
|
|
SET idle_in_transaction_session_timeout = 0;
|
|
|
|
SET client_encoding = 'UTF8';
|
|
|
|
SET standard_conforming_strings = on;
|
2018-04-11 16:02:29 +00:00
|
|
|
SELECT pg_catalog.set_config('search_path', '', false);
|
2018-01-16 15:11:23 +00:00
|
|
|
SET check_function_bodies = false;
|
|
|
|
SET client_min_messages = warning;
|
|
|
|
SET row_security = off;
|
|
|
|
|
2019-01-28 22:52:47 +00:00
|
|
|
--
|
|
|
|
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -
|
|
|
|
--
|
|
|
|
|
|
|
|
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: -
|
|
|
|
--
|
|
|
|
|
|
|
|
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
|
|
|
|
|
|
|
|
|
2018-01-16 15:11:23 +00:00
|
|
|
SET default_tablespace = '';
|
|
|
|
|
|
|
|
SET default_with_oids = false;
|
|
|
|
|
2018-08-22 17:44:35 +00:00
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: logs; Type: TABLE; Schema: public; Owner: -
|
2019-02-18 14:16:59 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
CREATE TABLE public.logs (
|
2019-02-18 14:16:59 +00:00
|
|
|
id integer NOT NULL,
|
|
|
|
block_number bigint,
|
2019-02-13 21:00:09 +00:00
|
|
|
address character varying(66),
|
|
|
|
tx_hash character varying(66),
|
|
|
|
index bigint,
|
|
|
|
topic0 character varying(66),
|
|
|
|
topic1 character varying(66),
|
|
|
|
topic2 character varying(66),
|
|
|
|
topic3 character varying(66),
|
|
|
|
data text,
|
|
|
|
receipt_id integer
|
2019-02-18 14:16:59 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: block_stats; Type: VIEW; Schema: public; Owner: -
|
2019-02-18 14:16:59 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
CREATE VIEW public.block_stats AS
|
|
|
|
SELECT max(logs.block_number) AS max_block,
|
|
|
|
min(logs.block_number) AS min_block
|
|
|
|
FROM public.logs;
|
2019-02-18 14:16:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: blocks; Type: TABLE; Schema: public; Owner: -
|
2019-02-18 14:16:59 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
CREATE TABLE public.blocks (
|
2019-02-18 14:16:59 +00:00
|
|
|
id integer NOT NULL,
|
2019-02-13 21:00:09 +00:00
|
|
|
difficulty bigint,
|
2019-03-18 22:21:31 +00:00
|
|
|
extra_data character varying,
|
2019-04-05 19:51:51 +00:00
|
|
|
gas_limit bigint,
|
|
|
|
gas_used bigint,
|
2019-02-13 21:00:09 +00:00
|
|
|
hash character varying(66),
|
2019-03-18 22:21:31 +00:00
|
|
|
miner character varying(42),
|
2019-02-13 21:00:09 +00:00
|
|
|
nonce character varying(20),
|
2019-03-18 22:21:31 +00:00
|
|
|
number bigint,
|
2019-04-05 19:51:51 +00:00
|
|
|
parent_hash character varying(66),
|
|
|
|
reward numeric,
|
|
|
|
uncles_reward numeric,
|
2019-02-13 21:00:09 +00:00
|
|
|
size character varying,
|
2019-03-18 22:21:31 +00:00
|
|
|
"time" bigint,
|
|
|
|
is_final boolean,
|
2019-02-13 21:00:09 +00:00
|
|
|
uncle_hash character varying(66),
|
|
|
|
eth_node_id integer NOT NULL,
|
|
|
|
eth_node_fingerprint character varying(128) NOT NULL
|
2019-02-18 14:16:59 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: blocks_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
2019-02-18 14:16:59 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
CREATE SEQUENCE public.blocks_id_seq
|
2019-02-18 14:16:59 +00:00
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
|
|
|
|
|
|
|
|
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: blocks_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
2019-02-18 14:16:59 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
ALTER SEQUENCE public.blocks_id_seq OWNED BY public.blocks.id;
|
2019-02-18 14:16:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: checked_headers; Type: TABLE; Schema: public; Owner: -
|
2019-02-18 14:16:59 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
CREATE TABLE public.checked_headers (
|
2019-02-18 14:16:59 +00:00
|
|
|
id integer NOT NULL,
|
2019-02-25 04:26:42 +00:00
|
|
|
header_id integer NOT NULL
|
2019-02-18 14:16:59 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: checked_headers_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
2019-02-18 14:16:59 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
CREATE SEQUENCE public.checked_headers_id_seq
|
2019-02-18 14:16:59 +00:00
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
|
|
|
|
|
|
|
|
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: checked_headers_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
2019-02-18 14:16:59 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
ALTER SEQUENCE public.checked_headers_id_seq OWNED BY public.checked_headers.id;
|
2019-02-18 14:16:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: eth_nodes; Type: TABLE; Schema: public; Owner: -
|
2019-02-18 14:16:59 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
CREATE TABLE public.eth_nodes (
|
2019-02-18 14:16:59 +00:00
|
|
|
id integer NOT NULL,
|
2019-03-18 22:21:31 +00:00
|
|
|
client_name character varying,
|
2019-02-13 21:00:09 +00:00
|
|
|
genesis_block character varying(66),
|
|
|
|
network_id numeric,
|
2019-03-18 22:21:31 +00:00
|
|
|
eth_node_id character varying(128)
|
2019-02-18 14:16:59 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
|
2019-03-21 19:52:24 +00:00
|
|
|
--
|
|
|
|
-- Name: full_sync_receipts; Type: TABLE; Schema: public; Owner: -
|
|
|
|
--
|
|
|
|
|
|
|
|
CREATE TABLE public.full_sync_receipts (
|
|
|
|
id integer NOT NULL,
|
|
|
|
contract_address character varying(42),
|
|
|
|
cumulative_gas_used numeric,
|
|
|
|
gas_used numeric,
|
|
|
|
state_root character varying(66),
|
|
|
|
status integer,
|
|
|
|
tx_hash character varying(66),
|
|
|
|
block_id integer NOT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Name: full_sync_receipts_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
|
|
--
|
|
|
|
|
|
|
|
CREATE SEQUENCE public.full_sync_receipts_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Name: full_sync_receipts_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
|
|
--
|
|
|
|
|
|
|
|
ALTER SEQUENCE public.full_sync_receipts_id_seq OWNED BY public.full_sync_receipts.id;
|
|
|
|
|
|
|
|
|
2019-03-19 19:11:26 +00:00
|
|
|
--
|
|
|
|
-- Name: full_sync_transactions; Type: TABLE; Schema: public; Owner: -
|
|
|
|
--
|
|
|
|
|
|
|
|
CREATE TABLE public.full_sync_transactions (
|
|
|
|
id integer NOT NULL,
|
|
|
|
block_id integer NOT NULL,
|
2019-04-05 19:51:51 +00:00
|
|
|
gas_limit numeric,
|
|
|
|
gas_price numeric,
|
2019-03-19 19:11:26 +00:00
|
|
|
hash character varying(66),
|
2019-03-27 04:05:30 +00:00
|
|
|
input_data bytea,
|
2019-03-19 19:11:26 +00:00
|
|
|
nonce numeric,
|
|
|
|
raw bytea,
|
|
|
|
tx_from character varying(66),
|
|
|
|
tx_index integer,
|
|
|
|
tx_to character varying(66),
|
|
|
|
value numeric
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Name: full_sync_transactions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
|
|
--
|
|
|
|
|
|
|
|
CREATE SEQUENCE public.full_sync_transactions_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Name: full_sync_transactions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
|
|
--
|
|
|
|
|
|
|
|
ALTER SEQUENCE public.full_sync_transactions_id_seq OWNED BY public.full_sync_transactions.id;
|
|
|
|
|
|
|
|
|
2019-02-18 14:16:59 +00:00
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: goose_db_version; Type: TABLE; Schema: public; Owner: -
|
2019-02-18 14:16:59 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
CREATE TABLE public.goose_db_version (
|
2019-02-18 14:16:59 +00:00
|
|
|
id integer NOT NULL,
|
2019-02-13 21:00:09 +00:00
|
|
|
version_id bigint NOT NULL,
|
|
|
|
is_applied boolean NOT NULL,
|
|
|
|
tstamp timestamp without time zone DEFAULT now()
|
2019-02-18 14:16:59 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: goose_db_version_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
2019-02-18 14:16:59 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
CREATE SEQUENCE public.goose_db_version_id_seq
|
2019-02-18 14:16:59 +00:00
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
2019-02-13 21:00:09 +00:00
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
2018-01-16 15:11:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: goose_db_version_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
2018-01-16 15:11:23 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
ALTER SEQUENCE public.goose_db_version_id_seq OWNED BY public.goose_db_version.id;
|
2018-01-16 15:11:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: headers; Type: TABLE; Schema: public; Owner: -
|
2018-01-16 15:11:23 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
CREATE TABLE public.headers (
|
|
|
|
id integer NOT NULL,
|
|
|
|
hash character varying(66),
|
|
|
|
block_number bigint,
|
|
|
|
raw jsonb,
|
|
|
|
block_timestamp numeric,
|
2019-04-05 19:51:51 +00:00
|
|
|
eth_node_id integer NOT NULL,
|
2019-02-13 21:00:09 +00:00
|
|
|
eth_node_fingerprint character varying(128)
|
|
|
|
);
|
2018-01-16 15:11:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: headers_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
2018-01-16 15:11:23 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
CREATE SEQUENCE public.headers_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
2018-01-16 15:11:23 +00:00
|
|
|
|
|
|
|
|
2018-09-12 14:30:40 +00:00
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: headers_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
2018-09-12 14:30:40 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
ALTER SEQUENCE public.headers_id_seq OWNED BY public.headers.id;
|
2018-09-12 14:30:40 +00:00
|
|
|
|
|
|
|
|
2019-03-21 19:52:24 +00:00
|
|
|
--
|
|
|
|
-- Name: light_sync_receipts; Type: TABLE; Schema: public; Owner: -
|
|
|
|
--
|
|
|
|
|
|
|
|
CREATE TABLE public.light_sync_receipts (
|
|
|
|
id integer NOT NULL,
|
|
|
|
transaction_id integer NOT NULL,
|
|
|
|
header_id integer NOT NULL,
|
|
|
|
contract_address character varying(42),
|
|
|
|
cumulative_gas_used numeric,
|
|
|
|
gas_used numeric,
|
|
|
|
state_root character varying(66),
|
|
|
|
status integer,
|
|
|
|
tx_hash character varying(66),
|
|
|
|
rlp bytea
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Name: light_sync_receipts_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
|
|
--
|
|
|
|
|
|
|
|
CREATE SEQUENCE public.light_sync_receipts_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Name: light_sync_receipts_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
|
|
--
|
|
|
|
|
|
|
|
ALTER SEQUENCE public.light_sync_receipts_id_seq OWNED BY public.light_sync_receipts.id;
|
|
|
|
|
|
|
|
|
2019-03-19 19:39:26 +00:00
|
|
|
--
|
|
|
|
-- Name: light_sync_transactions; Type: TABLE; Schema: public; Owner: -
|
|
|
|
--
|
|
|
|
|
|
|
|
CREATE TABLE public.light_sync_transactions (
|
|
|
|
id integer NOT NULL,
|
|
|
|
header_id integer NOT NULL,
|
2019-03-21 19:52:24 +00:00
|
|
|
hash character varying(66),
|
2019-04-05 19:51:51 +00:00
|
|
|
gas_limit numeric,
|
|
|
|
gas_price numeric,
|
2019-03-27 04:05:30 +00:00
|
|
|
input_data bytea,
|
|
|
|
nonce numeric,
|
|
|
|
raw bytea,
|
2019-03-21 19:52:24 +00:00
|
|
|
tx_from character varying(44),
|
2019-03-27 04:05:30 +00:00
|
|
|
tx_index integer,
|
2019-03-21 19:52:24 +00:00
|
|
|
tx_to character varying(44),
|
2019-03-27 04:05:30 +00:00
|
|
|
value numeric
|
2019-03-19 19:39:26 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Name: light_sync_transactions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
|
|
--
|
|
|
|
|
|
|
|
CREATE SEQUENCE public.light_sync_transactions_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Name: light_sync_transactions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
|
|
--
|
|
|
|
|
|
|
|
ALTER SEQUENCE public.light_sync_transactions_id_seq OWNED BY public.light_sync_transactions.id;
|
|
|
|
|
|
|
|
|
2018-08-22 17:44:35 +00:00
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: log_filters; Type: TABLE; Schema: public; Owner: -
|
2018-08-22 17:44:35 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
CREATE TABLE public.log_filters (
|
|
|
|
id integer NOT NULL,
|
|
|
|
name character varying NOT NULL,
|
|
|
|
from_block bigint,
|
|
|
|
to_block bigint,
|
|
|
|
address character varying(66),
|
|
|
|
topic0 character varying(66),
|
|
|
|
topic1 character varying(66),
|
|
|
|
topic2 character varying(66),
|
|
|
|
topic3 character varying(66),
|
|
|
|
CONSTRAINT log_filters_from_block_check CHECK ((from_block >= 0)),
|
|
|
|
CONSTRAINT log_filters_name_check CHECK (((name)::text <> ''::text)),
|
|
|
|
CONSTRAINT log_filters_to_block_check CHECK ((to_block >= 0))
|
|
|
|
);
|
2018-08-22 17:44:35 +00:00
|
|
|
|
|
|
|
|
2019-02-20 19:39:37 +00:00
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: log_filters_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
2019-02-20 19:39:37 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
CREATE SEQUENCE public.log_filters_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
2019-02-20 19:39:37 +00:00
|
|
|
|
|
|
|
|
2018-09-12 14:10:34 +00:00
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: log_filters_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
2018-09-12 14:10:34 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
ALTER SEQUENCE public.log_filters_id_seq OWNED BY public.log_filters.id;
|
2018-09-12 14:10:34 +00:00
|
|
|
|
|
|
|
|
2019-02-20 19:39:37 +00:00
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: logs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
2019-02-20 19:39:37 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
CREATE SEQUENCE public.logs_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
2019-02-20 19:39:37 +00:00
|
|
|
|
|
|
|
|
2018-09-12 14:10:34 +00:00
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: logs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
2018-09-12 14:10:34 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
ALTER SEQUENCE public.logs_id_seq OWNED BY public.logs.id;
|
2018-09-12 14:10:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: nodes_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
2018-09-12 14:10:34 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
CREATE SEQUENCE public.nodes_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
2018-09-12 14:10:34 +00:00
|
|
|
|
|
|
|
|
2019-02-21 20:33:59 +00:00
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: nodes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
2019-02-21 20:33:59 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
ALTER SEQUENCE public.nodes_id_seq OWNED BY public.eth_nodes.id;
|
2019-02-21 20:33:59 +00:00
|
|
|
|
|
|
|
|
2019-02-25 04:26:42 +00:00
|
|
|
--
|
|
|
|
-- Name: queued_storage; Type: TABLE; Schema: public; Owner: -
|
|
|
|
--
|
|
|
|
|
|
|
|
CREATE TABLE public.queued_storage (
|
|
|
|
id integer NOT NULL,
|
|
|
|
block_height bigint,
|
|
|
|
block_hash bytea,
|
|
|
|
contract bytea,
|
|
|
|
storage_key bytea,
|
|
|
|
storage_value bytea
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Name: queued_storage_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
|
|
--
|
|
|
|
|
|
|
|
CREATE SEQUENCE public.queued_storage_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Name: queued_storage_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
|
|
--
|
|
|
|
|
|
|
|
ALTER SEQUENCE public.queued_storage_id_seq OWNED BY public.queued_storage.id;
|
|
|
|
|
|
|
|
|
2019-02-21 20:33:59 +00:00
|
|
|
--
|
2019-03-21 19:52:24 +00:00
|
|
|
-- Name: uncles; Type: TABLE; Schema: public; Owner: -
|
2019-02-21 20:33:59 +00:00
|
|
|
--
|
|
|
|
|
2019-03-21 19:52:24 +00:00
|
|
|
CREATE TABLE public.uncles (
|
2019-02-13 21:00:09 +00:00
|
|
|
id integer NOT NULL,
|
2019-03-21 19:52:24 +00:00
|
|
|
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)
|
2019-02-13 21:00:09 +00:00
|
|
|
);
|
2019-02-21 20:33:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
--
|
2019-03-21 19:52:24 +00:00
|
|
|
-- Name: uncles_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
2019-02-21 20:33:59 +00:00
|
|
|
--
|
|
|
|
|
2019-03-21 19:52:24 +00:00
|
|
|
CREATE SEQUENCE public.uncles_id_seq
|
2019-02-13 21:00:09 +00:00
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
2019-02-21 20:33:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
--
|
2019-03-21 19:52:24 +00:00
|
|
|
-- Name: uncles_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
2019-02-21 20:33:59 +00:00
|
|
|
--
|
|
|
|
|
2019-03-21 19:52:24 +00:00
|
|
|
ALTER SEQUENCE public.uncles_id_seq OWNED BY public.uncles.id;
|
2019-02-21 20:33:59 +00:00
|
|
|
|
|
|
|
|
2019-04-05 19:51:51 +00:00
|
|
|
--
|
|
|
|
-- 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;
|
|
|
|
|
|
|
|
|
2019-02-20 19:39:37 +00:00
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: watched_contracts; Type: TABLE; Schema: public; Owner: -
|
2019-02-20 19:39:37 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
CREATE TABLE public.watched_contracts (
|
|
|
|
contract_id integer NOT NULL,
|
2019-03-18 22:21:31 +00:00
|
|
|
contract_abi json,
|
|
|
|
contract_hash character varying(66)
|
2019-02-13 21:00:09 +00:00
|
|
|
);
|
2019-02-20 19:39:37 +00:00
|
|
|
|
|
|
|
|
2018-09-04 16:35:38 +00:00
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: watched_contracts_contract_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
2018-09-04 16:35:38 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
CREATE SEQUENCE public.watched_contracts_contract_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
2018-09-04 16:35:38 +00:00
|
|
|
|
|
|
|
|
2019-02-20 19:39:37 +00:00
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: watched_contracts_contract_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
2019-02-20 19:39:37 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
ALTER SEQUENCE public.watched_contracts_contract_id_seq OWNED BY public.watched_contracts.contract_id;
|
2019-02-20 19:39:37 +00:00
|
|
|
|
|
|
|
|
2018-09-04 16:35:38 +00:00
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: watched_event_logs; Type: VIEW; Schema: public; Owner: -
|
2018-09-04 16:35:38 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
CREATE VIEW public.watched_event_logs AS
|
|
|
|
SELECT log_filters.name,
|
|
|
|
logs.id,
|
|
|
|
logs.block_number,
|
|
|
|
logs.address,
|
|
|
|
logs.tx_hash,
|
|
|
|
logs.index,
|
|
|
|
logs.topic0,
|
|
|
|
logs.topic1,
|
|
|
|
logs.topic2,
|
|
|
|
logs.topic3,
|
|
|
|
logs.data,
|
|
|
|
logs.receipt_id
|
|
|
|
FROM ((public.log_filters
|
|
|
|
CROSS JOIN public.block_stats)
|
|
|
|
JOIN public.logs ON ((((logs.address)::text = (log_filters.address)::text) AND (logs.block_number >= COALESCE(log_filters.from_block, block_stats.min_block)) AND (logs.block_number <= COALESCE(log_filters.to_block, block_stats.max_block)))))
|
|
|
|
WHERE ((((log_filters.topic0)::text = (logs.topic0)::text) OR (log_filters.topic0 IS NULL)) AND (((log_filters.topic1)::text = (logs.topic1)::text) OR (log_filters.topic1 IS NULL)) AND (((log_filters.topic2)::text = (logs.topic2)::text) OR (log_filters.topic2 IS NULL)) AND (((log_filters.topic3)::text = (logs.topic3)::text) OR (log_filters.topic3 IS NULL)));
|
2018-09-04 16:35:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: blocks id; Type: DEFAULT; Schema: public; Owner: -
|
2018-09-04 16:35:38 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
ALTER TABLE ONLY public.blocks ALTER COLUMN id SET DEFAULT nextval('public.blocks_id_seq'::regclass);
|
2018-09-04 16:35:38 +00:00
|
|
|
|
|
|
|
|
2018-11-06 17:11:09 +00:00
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: checked_headers id; Type: DEFAULT; Schema: public; Owner: -
|
2018-11-06 17:11:09 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
ALTER TABLE ONLY public.checked_headers ALTER COLUMN id SET DEFAULT nextval('public.checked_headers_id_seq'::regclass);
|
2018-11-06 17:11:09 +00:00
|
|
|
|
|
|
|
|
2018-08-07 15:51:34 +00:00
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: eth_nodes id; Type: DEFAULT; Schema: public; Owner: -
|
2018-08-07 15:51:34 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
ALTER TABLE ONLY public.eth_nodes ALTER COLUMN id SET DEFAULT nextval('public.nodes_id_seq'::regclass);
|
2018-08-07 15:51:34 +00:00
|
|
|
|
|
|
|
|
2019-03-21 19:52:24 +00:00
|
|
|
--
|
|
|
|
-- Name: full_sync_receipts id; Type: DEFAULT; Schema: public; Owner: -
|
|
|
|
--
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.full_sync_receipts ALTER COLUMN id SET DEFAULT nextval('public.full_sync_receipts_id_seq'::regclass);
|
|
|
|
|
|
|
|
|
2019-03-19 19:11:26 +00:00
|
|
|
--
|
|
|
|
-- Name: full_sync_transactions id; Type: DEFAULT; Schema: public; Owner: -
|
|
|
|
--
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.full_sync_transactions ALTER COLUMN id SET DEFAULT nextval('public.full_sync_transactions_id_seq'::regclass);
|
|
|
|
|
|
|
|
|
2018-09-26 14:42:52 +00:00
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: goose_db_version id; Type: DEFAULT; Schema: public; Owner: -
|
2018-09-26 14:42:52 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
ALTER TABLE ONLY public.goose_db_version ALTER COLUMN id SET DEFAULT nextval('public.goose_db_version_id_seq'::regclass);
|
2018-09-26 14:42:52 +00:00
|
|
|
|
|
|
|
|
2018-08-09 21:55:02 +00:00
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: headers id; Type: DEFAULT; Schema: public; Owner: -
|
2018-08-09 21:55:02 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
ALTER TABLE ONLY public.headers ALTER COLUMN id SET DEFAULT nextval('public.headers_id_seq'::regclass);
|
2018-08-09 21:55:02 +00:00
|
|
|
|
|
|
|
|
2019-03-21 19:52:24 +00:00
|
|
|
--
|
|
|
|
-- Name: light_sync_receipts id; Type: DEFAULT; Schema: public; Owner: -
|
|
|
|
--
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.light_sync_receipts ALTER COLUMN id SET DEFAULT nextval('public.light_sync_receipts_id_seq'::regclass);
|
|
|
|
|
|
|
|
|
2019-03-19 19:39:26 +00:00
|
|
|
--
|
|
|
|
-- Name: light_sync_transactions id; Type: DEFAULT; Schema: public; Owner: -
|
|
|
|
--
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.light_sync_transactions ALTER COLUMN id SET DEFAULT nextval('public.light_sync_transactions_id_seq'::regclass);
|
|
|
|
|
|
|
|
|
2019-02-20 19:39:37 +00:00
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: log_filters id; Type: DEFAULT; Schema: public; Owner: -
|
2019-02-20 19:39:37 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
ALTER TABLE ONLY public.log_filters ALTER COLUMN id SET DEFAULT nextval('public.log_filters_id_seq'::regclass);
|
2019-02-20 19:39:37 +00:00
|
|
|
|
|
|
|
|
2018-09-05 18:51:18 +00:00
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: logs id; Type: DEFAULT; Schema: public; Owner: -
|
2018-09-05 18:51:18 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
ALTER TABLE ONLY public.logs ALTER COLUMN id SET DEFAULT nextval('public.logs_id_seq'::regclass);
|
2018-09-05 18:51:18 +00:00
|
|
|
|
|
|
|
|
2019-02-25 04:26:42 +00:00
|
|
|
--
|
|
|
|
-- Name: queued_storage id; Type: DEFAULT; Schema: public; Owner: -
|
|
|
|
--
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.queued_storage ALTER COLUMN id SET DEFAULT nextval('public.queued_storage_id_seq'::regclass);
|
|
|
|
|
|
|
|
|
2018-08-29 14:12:29 +00:00
|
|
|
--
|
2019-03-21 19:52:24 +00:00
|
|
|
-- Name: uncles id; Type: DEFAULT; Schema: public; Owner: -
|
2018-09-05 14:24:28 +00:00
|
|
|
--
|
|
|
|
|
2019-03-21 19:52:24 +00:00
|
|
|
ALTER TABLE ONLY public.uncles ALTER COLUMN id SET DEFAULT nextval('public.uncles_id_seq'::regclass);
|
2018-09-05 14:24:28 +00:00
|
|
|
|
|
|
|
|
2019-04-05 19:51:51 +00:00
|
|
|
--
|
|
|
|
-- Name: uncles id; Type: DEFAULT; Schema: public; Owner: -
|
|
|
|
--
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.uncles ALTER COLUMN id SET DEFAULT nextval('public.uncles_id_seq'::regclass);
|
|
|
|
|
|
|
|
|
2019-02-20 19:39:37 +00:00
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: watched_contracts contract_id; Type: DEFAULT; Schema: public; Owner: -
|
2019-02-20 19:39:37 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
ALTER TABLE ONLY public.watched_contracts ALTER COLUMN contract_id SET DEFAULT nextval('public.watched_contracts_contract_id_seq'::regclass);
|
2019-02-20 19:39:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: blocks blocks_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
2019-02-20 19:39:37 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
ALTER TABLE ONLY public.blocks
|
|
|
|
ADD CONSTRAINT blocks_pkey PRIMARY KEY (id);
|
2019-02-20 19:39:37 +00:00
|
|
|
|
|
|
|
|
2018-10-08 21:39:57 +00:00
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: checked_headers checked_headers_header_id_key; Type: CONSTRAINT; Schema: public; Owner: -
|
2018-10-08 21:39:57 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
ALTER TABLE ONLY public.checked_headers
|
|
|
|
ADD CONSTRAINT checked_headers_header_id_key UNIQUE (header_id);
|
2018-10-08 21:39:57 +00:00
|
|
|
|
|
|
|
|
2019-02-20 19:39:37 +00:00
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: checked_headers checked_headers_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
2019-02-20 19:39:37 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
ALTER TABLE ONLY public.checked_headers
|
|
|
|
ADD CONSTRAINT checked_headers_pkey PRIMARY KEY (id);
|
2019-02-20 19:39:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: blocks eth_node_id_block_number_uc; Type: CONSTRAINT; Schema: public; Owner: -
|
2019-02-20 19:39:37 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
ALTER TABLE ONLY public.blocks
|
|
|
|
ADD CONSTRAINT eth_node_id_block_number_uc UNIQUE (number, eth_node_id);
|
2019-02-20 19:39:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: eth_nodes eth_node_uc; Type: CONSTRAINT; Schema: public; Owner: -
|
2019-02-20 19:39:37 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
ALTER TABLE ONLY public.eth_nodes
|
|
|
|
ADD CONSTRAINT eth_node_uc UNIQUE (genesis_block, network_id, eth_node_id);
|
2019-02-20 19:39:37 +00:00
|
|
|
|
|
|
|
|
2019-03-21 19:52:24 +00:00
|
|
|
--
|
|
|
|
-- Name: full_sync_receipts full_sync_receipts_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
|
|
|
--
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.full_sync_receipts
|
|
|
|
ADD CONSTRAINT full_sync_receipts_pkey PRIMARY KEY (id);
|
|
|
|
|
|
|
|
|
2019-03-19 19:11:26 +00:00
|
|
|
--
|
|
|
|
-- Name: full_sync_transactions full_sync_transactions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
|
|
|
--
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.full_sync_transactions
|
|
|
|
ADD CONSTRAINT full_sync_transactions_pkey PRIMARY KEY (id);
|
|
|
|
|
|
|
|
|
2019-02-20 19:39:37 +00:00
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: goose_db_version goose_db_version_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
2019-02-20 19:39:37 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
ALTER TABLE ONLY public.goose_db_version
|
|
|
|
ADD CONSTRAINT goose_db_version_pkey PRIMARY KEY (id);
|
2019-02-20 19:39:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: headers headers_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
2019-02-20 19:39:37 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
ALTER TABLE ONLY public.headers
|
|
|
|
ADD CONSTRAINT headers_pkey PRIMARY KEY (id);
|
2019-02-20 19:39:37 +00:00
|
|
|
|
|
|
|
|
2019-03-21 19:52:24 +00:00
|
|
|
--
|
|
|
|
-- Name: light_sync_receipts light_sync_receipts_header_id_transaction_id_key; Type: CONSTRAINT; Schema: public; Owner: -
|
|
|
|
--
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.light_sync_receipts
|
|
|
|
ADD CONSTRAINT light_sync_receipts_header_id_transaction_id_key UNIQUE (header_id, transaction_id);
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Name: light_sync_receipts light_sync_receipts_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
|
|
|
--
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.light_sync_receipts
|
|
|
|
ADD CONSTRAINT light_sync_receipts_pkey PRIMARY KEY (id);
|
|
|
|
|
|
|
|
|
2019-03-19 19:39:26 +00:00
|
|
|
--
|
|
|
|
-- Name: light_sync_transactions light_sync_transactions_header_id_hash_key; Type: CONSTRAINT; Schema: public; Owner: -
|
|
|
|
--
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.light_sync_transactions
|
|
|
|
ADD CONSTRAINT light_sync_transactions_header_id_hash_key UNIQUE (header_id, hash);
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Name: light_sync_transactions light_sync_transactions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
|
|
|
--
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.light_sync_transactions
|
|
|
|
ADD CONSTRAINT light_sync_transactions_pkey PRIMARY KEY (id);
|
|
|
|
|
|
|
|
|
2018-09-04 16:35:38 +00:00
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: logs logs_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
2018-09-04 16:35:38 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
ALTER TABLE ONLY public.logs
|
|
|
|
ADD CONSTRAINT logs_pkey PRIMARY KEY (id);
|
2018-09-04 16:35:38 +00:00
|
|
|
|
|
|
|
|
2019-02-20 19:39:37 +00:00
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: log_filters name_uc; Type: CONSTRAINT; Schema: public; Owner: -
|
2019-02-20 19:39:37 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
ALTER TABLE ONLY public.log_filters
|
|
|
|
ADD CONSTRAINT name_uc UNIQUE (name);
|
2019-02-20 19:39:37 +00:00
|
|
|
|
|
|
|
|
2018-10-12 14:13:13 +00:00
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: eth_nodes nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
2018-10-12 14:13:13 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
ALTER TABLE ONLY public.eth_nodes
|
|
|
|
ADD CONSTRAINT nodes_pkey PRIMARY KEY (id);
|
2018-10-12 14:13:13 +00:00
|
|
|
|
|
|
|
|
2018-10-15 20:04:17 +00:00
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: queued_storage queued_storage_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
2018-10-15 20:04:17 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
ALTER TABLE ONLY public.queued_storage
|
|
|
|
ADD CONSTRAINT queued_storage_pkey PRIMARY KEY (id);
|
2018-10-15 20:04:17 +00:00
|
|
|
|
|
|
|
|
2019-02-20 19:39:37 +00:00
|
|
|
--
|
2019-03-21 19:52:24 +00:00
|
|
|
-- Name: uncles uncles_block_id_hash_key; Type: CONSTRAINT; Schema: public; Owner: -
|
2019-02-20 19:39:37 +00:00
|
|
|
--
|
|
|
|
|
2019-03-21 19:52:24 +00:00
|
|
|
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);
|
2019-02-20 19:39:37 +00:00
|
|
|
|
|
|
|
|
2019-04-05 19:51:51 +00:00
|
|
|
--
|
|
|
|
-- 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);
|
|
|
|
|
|
|
|
|
2019-02-20 19:39:37 +00:00
|
|
|
--
|
2019-03-18 22:21:31 +00:00
|
|
|
-- Name: watched_contracts watched_contracts_contract_hash_key; Type: CONSTRAINT; Schema: public; Owner: -
|
2019-02-20 19:39:37 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
ALTER TABLE ONLY public.watched_contracts
|
2019-03-18 22:21:31 +00:00
|
|
|
ADD CONSTRAINT watched_contracts_contract_hash_key UNIQUE (contract_hash);
|
2019-02-20 19:39:37 +00:00
|
|
|
|
|
|
|
|
2018-10-04 21:49:09 +00:00
|
|
|
--
|
2019-03-18 22:21:31 +00:00
|
|
|
-- Name: watched_contracts watched_contracts_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
2018-10-04 21:49:09 +00:00
|
|
|
--
|
|
|
|
|
2019-03-18 22:21:31 +00:00
|
|
|
ALTER TABLE ONLY public.watched_contracts
|
|
|
|
ADD CONSTRAINT watched_contracts_pkey PRIMARY KEY (contract_id);
|
2018-10-04 21:49:09 +00:00
|
|
|
|
|
|
|
|
2019-02-20 19:39:37 +00:00
|
|
|
--
|
2019-03-18 22:21:31 +00:00
|
|
|
-- Name: block_id_index; Type: INDEX; Schema: public; Owner: -
|
2019-02-20 19:39:37 +00:00
|
|
|
--
|
|
|
|
|
2019-03-19 19:11:26 +00:00
|
|
|
CREATE INDEX block_id_index ON public.full_sync_transactions USING btree (block_id);
|
2019-02-20 19:39:37 +00:00
|
|
|
|
|
|
|
|
2019-03-05 10:52:38 +00:00
|
|
|
--
|
|
|
|
-- Name: headers_block_number; Type: INDEX; Schema: public; Owner: -
|
|
|
|
--
|
|
|
|
|
|
|
|
CREATE INDEX headers_block_number ON public.headers USING btree (block_number);
|
|
|
|
|
|
|
|
|
2019-02-20 19:39:37 +00:00
|
|
|
--
|
2019-02-13 21:00:09 +00:00
|
|
|
-- Name: node_id_index; Type: INDEX; Schema: public; Owner: -
|
2019-02-20 19:39:37 +00:00
|
|
|
--
|
|
|
|
|
2019-02-13 21:00:09 +00:00
|
|
|
CREATE INDEX node_id_index ON public.blocks USING btree (eth_node_id);
|
2019-02-20 19:39:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
--
|
2019-03-18 22:21:31 +00:00
|
|
|
-- Name: number_index; Type: INDEX; Schema: public; Owner: -
|
2019-02-20 19:39:37 +00:00
|
|
|
--
|
|
|
|
|
2019-03-18 22:21:31 +00:00
|
|
|
CREATE INDEX number_index ON public.blocks USING btree (number);
|
2019-02-20 19:39:37 +00:00
|
|
|
|
|
|
|
|
2018-10-25 10:19:46 +00:00
|
|
|
--
|
2019-03-18 22:21:31 +00:00
|
|
|
-- Name: tx_from_index; Type: INDEX; Schema: public; Owner: -
|
2018-10-25 10:19:46 +00:00
|
|
|
--
|
|
|
|
|
2019-03-19 19:11:26 +00:00
|
|
|
CREATE INDEX tx_from_index ON public.full_sync_transactions USING btree (tx_from);
|
2018-10-25 10:19:46 +00:00
|
|
|
|
|
|
|
|
2018-01-16 15:11:23 +00:00
|
|
|
--
|
2019-03-18 22:21:31 +00:00
|
|
|
-- Name: tx_to_index; Type: INDEX; Schema: public; Owner: -
|
2018-01-16 15:11:23 +00:00
|
|
|
--
|
|
|
|
|
2019-03-19 19:11:26 +00:00
|
|
|
CREATE INDEX tx_to_index ON public.full_sync_transactions USING btree (tx_to);
|
2018-01-16 15:11:23 +00:00
|
|
|
|
|
|
|
|
2018-05-01 16:35:01 +00:00
|
|
|
--
|
2019-03-21 19:52:24 +00:00
|
|
|
-- Name: full_sync_receipts blocks_fk; Type: FK CONSTRAINT; Schema: public; Owner: -
|
2018-05-01 16:35:01 +00:00
|
|
|
--
|
|
|
|
|
2019-03-21 19:52:24 +00:00
|
|
|
ALTER TABLE ONLY public.full_sync_receipts
|
2018-05-01 16:35:01 +00:00
|
|
|
ADD CONSTRAINT blocks_fk FOREIGN KEY (block_id) REFERENCES public.blocks(id) ON DELETE CASCADE;
|
2018-05-05 20:25:54 +00:00
|
|
|
|
|
|
|
|
2018-09-13 15:05:16 +00:00
|
|
|
--
|
|
|
|
-- Name: checked_headers checked_headers_header_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
|
|
--
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.checked_headers
|
|
|
|
ADD CONSTRAINT checked_headers_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE;
|
|
|
|
|
|
|
|
|
2018-07-17 21:23:07 +00:00
|
|
|
--
|
2019-04-05 19:51:51 +00:00
|
|
|
-- Name: full_sync_transactions full_sync_transactions_block_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
2018-07-17 21:23:07 +00:00
|
|
|
--
|
|
|
|
|
2019-04-05 19:51:51 +00:00
|
|
|
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;
|
2018-07-17 21:23:07 +00:00
|
|
|
|
|
|
|
|
2019-03-19 19:11:26 +00:00
|
|
|
--
|
2019-04-05 19:51:51 +00:00
|
|
|
-- Name: headers headers_eth_node_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
2019-03-19 19:11:26 +00:00
|
|
|
--
|
|
|
|
|
2019-04-05 19:51:51 +00:00
|
|
|
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;
|
2019-03-19 19:11:26 +00:00
|
|
|
|
|
|
|
|
2019-03-21 19:52:24 +00:00
|
|
|
--
|
|
|
|
-- Name: light_sync_receipts light_sync_receipts_header_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
|
|
--
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.light_sync_receipts
|
|
|
|
ADD CONSTRAINT light_sync_receipts_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE;
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Name: light_sync_receipts light_sync_receipts_transaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
|
|
--
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.light_sync_receipts
|
|
|
|
ADD CONSTRAINT light_sync_receipts_transaction_id_fkey FOREIGN KEY (transaction_id) REFERENCES public.light_sync_transactions(id) ON DELETE CASCADE;
|
|
|
|
|
|
|
|
|
2019-03-19 19:39:26 +00:00
|
|
|
--
|
|
|
|
-- Name: light_sync_transactions light_sync_transactions_header_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
|
|
--
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.light_sync_transactions
|
|
|
|
ADD CONSTRAINT light_sync_transactions_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE;
|
|
|
|
|
|
|
|
|
2018-01-16 15:11:23 +00:00
|
|
|
--
|
|
|
|
-- Name: blocks node_fk; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
|
|
--
|
|
|
|
|
2018-04-11 16:02:29 +00:00
|
|
|
ALTER TABLE ONLY public.blocks
|
|
|
|
ADD CONSTRAINT node_fk FOREIGN KEY (eth_node_id) REFERENCES public.eth_nodes(id) ON DELETE CASCADE;
|
2018-01-16 15:11:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Name: logs receipts_fk; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
|
|
--
|
|
|
|
|
2018-04-11 16:02:29 +00:00
|
|
|
ALTER TABLE ONLY public.logs
|
2019-03-21 19:52:24 +00:00
|
|
|
ADD CONSTRAINT receipts_fk FOREIGN KEY (receipt_id) REFERENCES public.full_sync_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;
|
2018-01-16 15:11:23 +00:00
|
|
|
|
|
|
|
|
2019-04-05 19:51:51 +00:00
|
|
|
--
|
|
|
|
-- 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;
|
|
|
|
|
|
|
|
|
2018-01-16 15:11:23 +00:00
|
|
|
--
|
|
|
|
-- PostgreSQL database dump complete
|
2019-01-28 22:52:47 +00:00
|
|
|
--
|
|
|
|
|