revert my data type mistake

This commit is contained in:
i-norden 2021-11-24 17:49:55 -06:00
parent 1c1826773b
commit 636fa35b84
6 changed files with 15 additions and 17 deletions

View File

@ -60,13 +60,11 @@ migrate: $(GOOSE) checkdbvars
.PHONY: migrate_pre_batch_set .PHONY: migrate_pre_batch_set
migrate_pre_batch_set: $(GOOSE) checkdbvars migrate_pre_batch_set: $(GOOSE) checkdbvars
$(GOOSE) -dir db/pre_batch_processing_migrations postgres "$(CONNECT_STRING)" up $(GOOSE) -dir db/pre_batch_processing_migrations postgres "$(CONNECT_STRING)" up
pg_dump -O -s $(CONNECT_STRING) > schema.sql
## Apply migrations to be ran after a batch processing ## Apply migrations to be ran after a batch processing
.PHONY: migrate_post_batch_set .PHONY: migrate_post_batch_set
migrate_post_batch_set: $(GOOSE) checkdbvars migrate_post_batch_set: $(GOOSE) checkdbvars
$(GOOSE) -dir db/post_batch_processing_migrations postgres "$(CONNECT_STRING)" up $(GOOSE) -dir db/post_batch_processing_migrations postgres "$(CONNECT_STRING)" up
pg_dump -O -s $(CONNECT_STRING) > schema.sql
## Create a new migration file ## Create a new migration file
.PHONY: new_migration .PHONY: new_migration

View File

@ -5,9 +5,9 @@ CREATE TABLE eth.header_cids (
parent_hash VARCHAR(66) NOT NULL, parent_hash VARCHAR(66) NOT NULL,
cid TEXT NOT NULL, cid TEXT NOT NULL,
mh_key TEXT NOT NULL REFERENCES public.blocks (key) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED, mh_key TEXT NOT NULL REFERENCES public.blocks (key) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
td BIGINT NOT NULL, td NUMERIC NOT NULL,
node_id VARCHAR(128) NOT NULL REFERENCES nodes (node_id) ON DELETE CASCADE, node_id VARCHAR(128) NOT NULL REFERENCES nodes (node_id) ON DELETE CASCADE,
reward BIGINT NOT NULL, reward NUMERIC NOT NULL,
state_root VARCHAR(66) NOT NULL, state_root VARCHAR(66) NOT NULL,
tx_root VARCHAR(66) NOT NULL, tx_root VARCHAR(66) NOT NULL,
receipt_root VARCHAR(66) NOT NULL, receipt_root VARCHAR(66) NOT NULL,
@ -15,7 +15,7 @@ CREATE TABLE eth.header_cids (
bloom BYTEA NOT NULL, bloom BYTEA NOT NULL,
timestamp BIGINT NOT NULL, timestamp BIGINT NOT NULL,
times_validated INTEGER NOT NULL DEFAULT 1, times_validated INTEGER NOT NULL DEFAULT 1,
base_fee BIGINT base_fee NUMERIC
); );
-- +goose Down -- +goose Down

View File

@ -2,8 +2,8 @@
CREATE TABLE eth.state_accounts ( CREATE TABLE eth.state_accounts (
header_id VARCHAR(66) NOT NULL, header_id VARCHAR(66) NOT NULL,
state_path BYTEA NOT NULL, state_path BYTEA NOT NULL,
balance BIGINT NOT NULL, balance NUMERIC NOT NULL,
nonce INTEGER NOT NULL, nonce BIGINT NOT NULL,
code_hash BYTEA NOT NULL, code_hash BYTEA NOT NULL,
storage_root VARCHAR(66) NOT NULL, storage_root VARCHAR(66) NOT NULL,
FOREIGN KEY (header_id, state_path) REFERENCES eth.state_cids (header_id, state_path) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED, FOREIGN KEY (header_id, state_path) REFERENCES eth.state_cids (header_id, state_path) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,

View File

@ -5,9 +5,9 @@ CREATE TABLE eth.header_cids (
parent_hash VARCHAR(66) NOT NULL, parent_hash VARCHAR(66) NOT NULL,
cid TEXT NOT NULL, cid TEXT NOT NULL,
mh_key TEXT NOT NULL, mh_key TEXT NOT NULL,
td BIGINT NOT NULL, td NUMERIC NOT NULL,
node_id VARCHAR(128) NOT NULL, node_id VARCHAR(128) NOT NULL,
reward BIGINT NOT NULL, reward NUMERIC NOT NULL,
state_root VARCHAR(66) NOT NULL, state_root VARCHAR(66) NOT NULL,
tx_root VARCHAR(66) NOT NULL, tx_root VARCHAR(66) NOT NULL,
receipt_root VARCHAR(66) NOT NULL, receipt_root VARCHAR(66) NOT NULL,
@ -15,7 +15,7 @@ CREATE TABLE eth.header_cids (
bloom BYTEA NOT NULL, bloom BYTEA NOT NULL,
timestamp BIGINT NOT NULL, timestamp BIGINT NOT NULL,
times_validated INTEGER NOT NULL DEFAULT 1, times_validated INTEGER NOT NULL DEFAULT 1,
base_fee BIGINT base_fee NUMERIC
); );
-- +goose Down -- +goose Down

View File

@ -2,8 +2,8 @@
CREATE TABLE eth.state_accounts ( CREATE TABLE eth.state_accounts (
header_id VARCHAR(66) NOT NULL, header_id VARCHAR(66) NOT NULL,
state_path BYTEA NOT NULL, state_path BYTEA NOT NULL,
balance BIGINT NOT NULL, balance NUMERIC NOT NULL,
nonce INTEGER NOT NULL, nonce BIGINT NOT NULL,
code_hash BYTEA NOT NULL, code_hash BYTEA NOT NULL,
storage_root VARCHAR(66) NOT NULL storage_root VARCHAR(66) NOT NULL
); );

View File

@ -37,9 +37,9 @@ CREATE TABLE eth.header_cids (
parent_hash character varying(66) NOT NULL, parent_hash character varying(66) NOT NULL,
cid text NOT NULL, cid text NOT NULL,
mh_key text NOT NULL, mh_key text NOT NULL,
td bigint NOT NULL, td numeric NOT NULL,
node_id character varying(128) NOT NULL, node_id character varying(128) NOT NULL,
reward bigint NOT NULL, reward numeric NOT NULL,
state_root character varying(66) NOT NULL, state_root character varying(66) NOT NULL,
tx_root character varying(66) NOT NULL, tx_root character varying(66) NOT NULL,
receipt_root character varying(66) NOT NULL, receipt_root character varying(66) NOT NULL,
@ -47,7 +47,7 @@ CREATE TABLE eth.header_cids (
bloom bytea NOT NULL, bloom bytea NOT NULL,
"timestamp" bigint NOT NULL, "timestamp" bigint NOT NULL,
times_validated integer DEFAULT 1 NOT NULL, times_validated integer DEFAULT 1 NOT NULL,
base_fee bigint base_fee numeric
); );
@ -265,8 +265,8 @@ CREATE TABLE eth.receipt_cids (
CREATE TABLE eth.state_accounts ( CREATE TABLE eth.state_accounts (
header_id character varying(66) NOT NULL, header_id character varying(66) NOT NULL,
state_path bytea NOT NULL, state_path bytea NOT NULL,
balance bigint NOT NULL, balance numeric NOT NULL,
nonce integer NOT NULL, nonce bigint NOT NULL,
code_hash bytea NOT NULL, code_hash bytea NOT NULL,
storage_root character varying(66) NOT NULL storage_root character varying(66) NOT NULL
); );