-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
Consolidate migrations
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,23 @@ | ||
-- +goose Up | ||
CREATE TABLE public.blocks | ||
( | ||
block_number BIGINT | ||
CREATE TABLE public.blocks ( | ||
id SERIAL PRIMARY KEY, | ||
difficulty BIGINT, | ||
extra_data VARCHAR, | ||
gaslimit BIGINT, | ||
gasused BIGINT, | ||
hash VARCHAR(66), | ||
miner VARCHAR(42), | ||
nonce VARCHAR(20), | ||
"number" BIGINT, | ||
parenthash VARCHAR(66), | ||
reward DOUBLE PRECISION, | ||
uncles_reward DOUBLE PRECISION, | ||
"size" VARCHAR, | ||
"time" BIGINT, | ||
is_final BOOLEAN, | ||
uncle_hash VARCHAR(66) | ||
); | ||
|
||
|
||
-- +goose Down | ||
DROP TABLE public.blocks; | ||
DROP TABLE public.blocks; |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
-- +goose Up | ||
CREATE TABLE transactions ( | ||
id SERIAL PRIMARY KEY, | ||
block_id INTEGER NOT NULL REFERENCES blocks(id) ON DELETE CASCADE, | ||
input_data VARCHAR, | ||
tx_from VARCHAR(66), | ||
gaslimit NUMERIC, | ||
gasprice NUMERIC, | ||
hash VARCHAR(66), | ||
nonce NUMERIC, | ||
tx_to VARCHAR(66), | ||
"value" NUMERIC | ||
); | ||
|
||
-- +goose Down | ||
DROP TABLE transactions; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
-- +goose Up | ||
CREATE INDEX number_index ON blocks (number); | ||
|
||
|
||
-- +goose Down | ||
DROP INDEX number_index; |
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
-- +goose Up | ||
CREATE TABLE nodes ( | ||
id SERIAL PRIMARY KEY, | ||
client_name VARCHAR, | ||
genesis_block VARCHAR(66), | ||
network_id NUMERIC, | ||
node_id VARCHAR(128), | ||
CONSTRAINT node_uc UNIQUE (genesis_block, network_id, node_id) | ||
); | ||
|
||
-- +goose Down | ||
DROP TABLE nodes; |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.