From 1db8a682df1e4871b4298912b84f595d887c9e97 Mon Sep 17 00:00:00 2001 From: Arijit Das Date: Fri, 8 Oct 2021 18:33:37 +0530 Subject: [PATCH] Upgrade statediff image to v0.9.0. --- .github/workflow/on-pr.yaml | 2 +- db/migrations/00014_create_stored_functions.sql | 2 +- db/migrations/00015_create_access_list_table.sql | 12 ++++++------ docker-compose.test.yml | 2 +- schema.sql | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflow/on-pr.yaml b/.github/workflow/on-pr.yaml index c5935d7..1ec6c59 100644 --- a/.github/workflow/on-pr.yaml +++ b/.github/workflow/on-pr.yaml @@ -33,7 +33,7 @@ jobs: sleep 10 docker run --rm --network host -e DATABASE_USER=vdbm -e DATABASE_PASSWORD=password \ -e DATABASE_HOSTNAME=127.0.0.1 -e DATABASE_PORT=8066 -e DATABASE_NAME=vulcanize_testing \ - vulcanize/statediff-migrations:v0.8.0 + vulcanize/statediff-migrations:v0.9.0 - name: Verify schema is latest run: | PGPASSWORD="password" pg_dump -h localhost -p 8066 -U vdbm vulcanize_testing --no-owner --schema-only > ./db/migration_schema.sql diff --git a/db/migrations/00014_create_stored_functions.sql b/db/migrations/00014_create_stored_functions.sql index 81d7a40..cdf579c 100644 --- a/db/migrations/00014_create_stored_functions.sql +++ b/db/migrations/00014_create_stored_functions.sql @@ -78,7 +78,7 @@ BEGIN -- if none of the headers had children, none is more canonical than the other IF has_children_count = 0 THEN -- return the first one selected - SELECT * INTO canonical_header FROM unnest(headers) LIMIT 1; + SELECT * INTO canonical_header FROM unnest(headers) LIMIT 1; -- if only one header had children, it can be considered the heaviest/canonical header of the set ELSIF has_children_count = 1 THEN -- return the only header with a child diff --git a/db/migrations/00015_create_access_list_table.sql b/db/migrations/00015_create_access_list_table.sql index 46a54ce..3e27a63 100644 --- a/db/migrations/00015_create_access_list_table.sql +++ b/db/migrations/00015_create_access_list_table.sql @@ -1,11 +1,11 @@ -- +goose Up CREATE TABLE eth.access_list_element ( - id SERIAL PRIMARY KEY, - tx_id INTEGER NOT NULL REFERENCES eth.transaction_cids (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED, - index INTEGER NOT NULL, - address VARCHAR(66), - storage_keys VARCHAR(66)[], - UNIQUE (tx_id, index) + id SERIAL PRIMARY KEY, + tx_id INTEGER NOT NULL REFERENCES eth.transaction_cids (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED, + index INTEGER NOT NULL, + address VARCHAR(66), + storage_keys VARCHAR(66)[], + UNIQUE (tx_id, index) ); CREATE INDEX accesss_list_element_address_index ON eth.access_list_element USING btree (address); diff --git a/docker-compose.test.yml b/docker-compose.test.yml index 6fc915d..8e93c52 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -5,7 +5,7 @@ services: restart: on-failure depends_on: - test-db - image: vulcanize/statediff-migrations:v0.8.0 + image: vulcanize/statediff-migrations:v0.9.0 test-db: restart: always diff --git a/schema.sql b/schema.sql index 7d06e8b..805961e 100644 --- a/schema.sql +++ b/schema.sql @@ -134,7 +134,7 @@ BEGIN -- if none of the headers had children, none is more canonical than the other IF has_children_count = 0 THEN -- return the first one selected - SELECT * INTO canonical_header FROM unnest(headers) LIMIT 1; + SELECT * INTO canonical_header FROM unnest(headers) LIMIT 1; -- if only one header had children, it can be considered the heaviest/canonical header of the set ELSIF has_children_count = 1 THEN -- return the only header with a child