Skip to content

Commit

Permalink
Merge pull request #59 from vulcanize/release-v3.2.0
Browse files Browse the repository at this point in the history
update the pre- and post- batch sets with new meta schema and tables
  • Loading branch information
i-norden authored Mar 31, 2022
2 parents 82f28ae + 201cadb commit 05600e5
Show file tree
Hide file tree
Showing 13 changed files with 75 additions and 43 deletions.
12 changes: 6 additions & 6 deletions db/migrations/00021_create_known_gaps_table.sql
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
-- +goose Up
CREATE TABLE eth.known_gaps (
starting_block_number bigint PRIMARY KEY,
ending_block_number bigint,
checked_out boolean,
processing_key bigint
CREATE TABLE eth_meta.known_gaps (
starting_block_number bigint PRIMARY KEY,
ending_block_number bigint,
checked_out boolean,
processing_key bigint
);

-- +goose Down
DROP TABLE eth.known_gaps;
DROP TABLE eth_meta.known_gaps;
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
-- +goose Up
ALTER TABLE public.nodes
ADD CONSTRAINT pk_public_nodes PRIMARY KEY (node_id);

ALTER TABLE eth.header_cids
ADD CONSTRAINT pk_eth_header_cids PRIMARY KEY (block_hash);

ALTER TABLE eth.uncle_cids
ADD CONSTRAINT pk_eth_uncle_cids PRIMARY KEY (block_hash);

ALTER TABLE eth.transaction_cids
ADD CONSTRAINT pk_eth_transaction_cids PRIMARY KEY (tx_hash);

ALTER TABLE eth.receipt_cids
ADD CONSTRAINT pk_eth_receipt_cids PRIMARY KEY (tx_id);

Expand Down Expand Up @@ -35,3 +47,15 @@ DROP CONSTRAINT pk_eth_access_list_elements;

ALTER TABLE eth.receipt_cids
DROP CONSTRAINT pk_eth_receipt_cids;

ALTER TABLE eth.transaction_cids
DROP CONSTRAINT pk_eth_transaction_cids;

ALTER TABLE eth.uncle_cids
DROP CONSTRAINT pk_eth_uncle_cids;

ALTER TABLE eth.header_cids
DROP CONSTRAINT pk_eth_header_cids;

ALTER TABLE public.nodes
DROP CONSTRAINT pk_public_nodes;

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- +goose Up
CREATE SCHEMA eth_meta;

-- +goose Down
DROP SCHEMA eth_meta;
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
-- +goose Up
CREATE TABLE eth_meta.watched_addresses (
address VARCHAR(66) PRIMARY KEY,
created_at BIGINT NOT NULL,
watched_at BIGINT NOT NULL,
last_filled_at BIGINT NOT NULL DEFAULT 0
);

-- +goose Down
DROP TABLE eth_meta.watched_addresses;
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
-- +goose Up
CREATE TABLE eth_meta.known_gaps (
starting_block_number bigint PRIMARY KEY,
ending_block_number bigint,
checked_out boolean,
processing_key bigint
);

-- +goose Down
DROP TABLE eth_meta.known_gaps;
32 changes: 20 additions & 12 deletions schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,18 @@ CREATE TABLE eth.uncle_cids (
);


--
-- Name: known_gaps; Type: TABLE; Schema: eth_meta; Owner: -
--

CREATE TABLE eth_meta.known_gaps (
starting_block_number bigint NOT NULL,
ending_block_number bigint,
checked_out boolean,
processing_key bigint
);


--
-- Name: watched_addresses; Type: TABLE; Schema: eth_meta; Owner: -
--
Expand Down Expand Up @@ -488,18 +500,6 @@ CREATE TABLE public.nodes (
);


--
-- Name: known_gaps; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE eth.known_gaps (
starting_block_number bigint PRIMARY KEY,
ending_block_number bigint,
checked_out boolean,
processing_key bigint
);


--
-- Name: TABLE nodes; Type: COMMENT; Schema: public; Owner: -
--
Expand Down Expand Up @@ -593,6 +593,14 @@ ALTER TABLE ONLY eth.uncle_cids
ADD CONSTRAINT uncle_cids_pkey PRIMARY KEY (block_hash);


--
-- Name: known_gaps known_gaps_pkey; Type: CONSTRAINT; Schema: eth_meta; Owner: -
--

ALTER TABLE ONLY eth_meta.known_gaps
ADD CONSTRAINT known_gaps_pkey PRIMARY KEY (starting_block_number);


--
-- Name: watched_addresses watched_addresses_pkey; Type: CONSTRAINT; Schema: eth_meta; Owner: -
--
Expand Down

0 comments on commit 05600e5

Please sign in to comment.