Merge pull request #26 from vulcanize/schema_updates
revert my data type mistake
This commit is contained in:
commit
6c27203579
2
Makefile
2
Makefile
@ -60,13 +60,11 @@ migrate: $(GOOSE) checkdbvars
|
||||
.PHONY: migrate_pre_batch_set
|
||||
migrate_pre_batch_set: $(GOOSE) checkdbvars
|
||||
$(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
|
||||
.PHONY: migrate_post_batch_set
|
||||
migrate_post_batch_set: $(GOOSE) checkdbvars
|
||||
$(GOOSE) -dir db/post_batch_processing_migrations postgres "$(CONNECT_STRING)" up
|
||||
pg_dump -O -s $(CONNECT_STRING) > schema.sql
|
||||
|
||||
## Create a new migration file
|
||||
.PHONY: new_migration
|
||||
|
@ -5,9 +5,9 @@ CREATE TABLE eth.header_cids (
|
||||
parent_hash VARCHAR(66) NOT NULL,
|
||||
cid TEXT NOT NULL,
|
||||
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,
|
||||
reward BIGINT NOT NULL,
|
||||
reward NUMERIC NOT NULL,
|
||||
state_root VARCHAR(66) NOT NULL,
|
||||
tx_root VARCHAR(66) NOT NULL,
|
||||
receipt_root VARCHAR(66) NOT NULL,
|
||||
@ -15,7 +15,7 @@ CREATE TABLE eth.header_cids (
|
||||
bloom BYTEA NOT NULL,
|
||||
timestamp BIGINT NOT NULL,
|
||||
times_validated INTEGER NOT NULL DEFAULT 1,
|
||||
base_fee BIGINT
|
||||
base_fee NUMERIC
|
||||
);
|
||||
|
||||
-- +goose Down
|
||||
|
@ -2,8 +2,8 @@
|
||||
CREATE TABLE eth.state_accounts (
|
||||
header_id VARCHAR(66) NOT NULL,
|
||||
state_path BYTEA NOT NULL,
|
||||
balance BIGINT NOT NULL,
|
||||
nonce INTEGER NOT NULL,
|
||||
balance NUMERIC NOT NULL,
|
||||
nonce BIGINT NOT NULL,
|
||||
code_hash BYTEA 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,
|
||||
|
@ -5,9 +5,9 @@ CREATE TABLE eth.header_cids (
|
||||
parent_hash VARCHAR(66) NOT NULL,
|
||||
cid TEXT NOT NULL,
|
||||
mh_key TEXT NOT NULL,
|
||||
td BIGINT NOT NULL,
|
||||
td NUMERIC NOT NULL,
|
||||
node_id VARCHAR(128) NOT NULL,
|
||||
reward BIGINT NOT NULL,
|
||||
reward NUMERIC NOT NULL,
|
||||
state_root VARCHAR(66) NOT NULL,
|
||||
tx_root VARCHAR(66) NOT NULL,
|
||||
receipt_root VARCHAR(66) NOT NULL,
|
||||
@ -15,7 +15,7 @@ CREATE TABLE eth.header_cids (
|
||||
bloom BYTEA NOT NULL,
|
||||
timestamp BIGINT NOT NULL,
|
||||
times_validated INTEGER NOT NULL DEFAULT 1,
|
||||
base_fee BIGINT
|
||||
base_fee NUMERIC
|
||||
);
|
||||
|
||||
-- +goose Down
|
||||
|
@ -2,8 +2,8 @@
|
||||
CREATE TABLE eth.state_accounts (
|
||||
header_id VARCHAR(66) NOT NULL,
|
||||
state_path BYTEA NOT NULL,
|
||||
balance BIGINT NOT NULL,
|
||||
nonce INTEGER NOT NULL,
|
||||
balance NUMERIC NOT NULL,
|
||||
nonce BIGINT NOT NULL,
|
||||
code_hash BYTEA NOT NULL,
|
||||
storage_root VARCHAR(66) NOT NULL
|
||||
);
|
||||
|
10
schema.sql
10
schema.sql
@ -37,9 +37,9 @@ CREATE TABLE eth.header_cids (
|
||||
parent_hash character varying(66) NOT NULL,
|
||||
cid text NOT NULL,
|
||||
mh_key text NOT NULL,
|
||||
td bigint NOT NULL,
|
||||
td numeric NOT NULL,
|
||||
node_id character varying(128) NOT NULL,
|
||||
reward bigint NOT NULL,
|
||||
reward numeric NOT NULL,
|
||||
state_root character varying(66) NOT NULL,
|
||||
tx_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,
|
||||
"timestamp" bigint 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 (
|
||||
header_id character varying(66) NOT NULL,
|
||||
state_path bytea NOT NULL,
|
||||
balance bigint NOT NULL,
|
||||
nonce integer NOT NULL,
|
||||
balance numeric NOT NULL,
|
||||
nonce bigint NOT NULL,
|
||||
code_hash bytea NOT NULL,
|
||||
storage_root character varying(66) NOT NULL
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user