forked from cerc-io/ipld-eth-server
Associate saved transactions to their block
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
ALTER TABLE transactions
|
||||
DROP COLUMN block_id
|
||||
@@ -0,0 +1,5 @@
|
||||
ALTER TABLE transactions
|
||||
ADD COLUMN block_id INTEGER NOT NULL,
|
||||
ADD CONSTRAINT fk_test
|
||||
FOREIGN KEY (block_id)
|
||||
REFERENCES blocks (id)
|
||||
+11
-1
@@ -87,7 +87,8 @@ CREATE TABLE transactions (
|
||||
tx_to character varying(66),
|
||||
tx_gaslimit numeric,
|
||||
tx_gasprice numeric,
|
||||
tx_value numeric
|
||||
tx_value numeric,
|
||||
block_id integer NOT NULL
|
||||
);
|
||||
|
||||
|
||||
@@ -148,6 +149,15 @@ ALTER TABLE ONLY transactions
|
||||
ADD CONSTRAINT transactions_pkey PRIMARY KEY (id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: transactions fk_test; Type: FK CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY transactions
|
||||
ADD CONSTRAINT fk_test FOREIGN KEY (block_id) REFERENCES blocks(id);
|
||||
|
||||
|
||||
--
|
||||
-- PostgreSQL database dump complete
|
||||
--
|
||||
|
||||
|
||||
Reference in New Issue
Block a user