diff --git a/integration_test/geth_blockchain_test.go b/integration_test/geth_blockchain_test.go index 4109ccd1..e308e8c0 100644 --- a/integration_test/geth_blockchain_test.go +++ b/integration_test/geth_blockchain_test.go @@ -2,13 +2,14 @@ package integration_test import ( "fmt" - "github.com/8thlight/vulcanizedb/core" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" "math/big" "path" "path/filepath" "runtime" + + "github.com/8thlight/vulcanizedb/core" + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" ) var ( diff --git a/migrations/1509391861_add_primary_key_to_blocks.down.sql b/migrations/1509391861_add_primary_key_to_blocks.down.sql new file mode 100644 index 00000000..8840f9d2 --- /dev/null +++ b/migrations/1509391861_add_primary_key_to_blocks.down.sql @@ -0,0 +1 @@ +ALTER TABLE blocks DROP id \ No newline at end of file diff --git a/migrations/1509391861_add_primary_key_to_blocks.up.sql b/migrations/1509391861_add_primary_key_to_blocks.up.sql new file mode 100644 index 00000000..e2b68955 --- /dev/null +++ b/migrations/1509391861_add_primary_key_to_blocks.up.sql @@ -0,0 +1 @@ +ALTER TABLE blocks ADD COLUMN id SERIAL PRIMARY KEY \ No newline at end of file diff --git a/migrations/schema.sql b/migrations/schema.sql index bc17a417..ae617c5b 100644 --- a/migrations/schema.sql +++ b/migrations/schema.sql @@ -42,10 +42,31 @@ CREATE TABLE blocks ( block_number bigint, block_gaslimit double precision, block_gasused double precision, - block_time double precision + block_time double precision, + id integer NOT NULL ); +-- +-- Name: blocks_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE blocks_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: blocks_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - +-- + +ALTER SEQUENCE blocks_id_seq OWNED BY blocks.id; + + -- -- Name: schema_migrations; Type: TABLE; Schema: public; Owner: - -- @@ -56,6 +77,21 @@ CREATE TABLE schema_migrations ( ); +-- +-- Name: blocks id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY blocks ALTER COLUMN id SET DEFAULT nextval('blocks_id_seq'::regclass); + + +-- +-- Name: blocks blocks_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY blocks + ADD CONSTRAINT blocks_pkey PRIMARY KEY (id); + + -- -- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: - --