Add eth.blob_hashes table #8
@ -14,9 +14,10 @@ jobs:
|
|||||||
- name: Check migration version
|
- name: Check migration version
|
||||||
timeout-minutes: 1
|
timeout-minutes: 1
|
||||||
run: |
|
run: |
|
||||||
|
MIGRATION_VERSION=$(ls db/migrations/*.sql | wc -l)
|
||||||
while
|
while
|
||||||
version=$(docker compose run --rm migrations version 2>&1 | tail -1 | awk '{print $(NF)}')
|
version=$(docker compose run --rm migrations version 2>&1 | tail -1 | awk '{print $(NF)}')
|
||||||
[[ $version != 21 ]]; do
|
[[ $version != $MIGRATION_VERSION ]]; do
|
||||||
echo "Incorrect version: $version"
|
echo "Incorrect version: $version"
|
||||||
echo "Retrying..."
|
echo "Retrying..."
|
||||||
done
|
done
|
||||||
|
12
db/migrations/00022_create_eth_blob_hash_cids_table.sql
Normal file
12
db/migrations/00022_create_eth_blob_hash_cids_table.sql
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
-- +goose Up
|
||||||
|
CREATE TABLE eth.blob_hashes (
|
||||||
|
tx_hash VARCHAR(66) NOT NULL,
|
||||||
|
index INTEGER NOT NULL,
|
||||||
|
blob_hash BYTEA NOT NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE UNIQUE INDEX blob_hashes_tx_hash_index ON eth.blob_hashes(tx_hash, index);
|
||||||
|
|
||||||
|
-- +goose Down
|
||||||
|
DROP INDEX eth.blob_hashes_tx_hash_index;
|
||||||
|
DROP TABLE eth.blob_hashes;
|
18
schema.sql
18
schema.sql
@ -190,6 +190,17 @@ SET default_tablespace = '';
|
|||||||
|
|
||||||
SET default_table_access_method = heap;
|
SET default_table_access_method = heap;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: blob_hashes; Type: TABLE; Schema: eth; Owner: -
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE eth.blob_hashes (
|
||||||
|
tx_hash character varying(66) NOT NULL,
|
||||||
|
index integer NOT NULL,
|
||||||
|
blob_hash bytea NOT NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Name: header_cids; Type: TABLE; Schema: eth; Owner: -
|
-- Name: header_cids; Type: TABLE; Schema: eth; Owner: -
|
||||||
--
|
--
|
||||||
@ -554,6 +565,13 @@ ALTER TABLE ONLY public.nodes
|
|||||||
ADD CONSTRAINT nodes_pkey PRIMARY KEY (node_id);
|
ADD CONSTRAINT nodes_pkey PRIMARY KEY (node_id);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: blob_hashes_tx_hash_index; Type: INDEX; Schema: eth; Owner: -
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE UNIQUE INDEX blob_hashes_tx_hash_index ON eth.blob_hashes USING btree (tx_hash, index);
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Name: header_block_number_index; Type: INDEX; Schema: eth; Owner: -
|
-- Name: header_block_number_index; Type: INDEX; Schema: eth; Owner: -
|
||||||
--
|
--
|
||||||
|
Loading…
Reference in New Issue
Block a user