forked from cerc-io/ipld-eth-server
make db fks deferrable so that we can commit entire cid payload in single transaction; adjust buffer sizes to optimize performane and stability
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE public.transaction_cids (
|
||||
id SERIAL PRIMARY KEY,
|
||||
header_id INTEGER NOT NULL REFERENCES header_cids (id) ON DELETE CASCADE,
|
||||
header_id INTEGER NOT NULL REFERENCES header_cids (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
|
||||
tx_hash VARCHAR(66) NOT NULL,
|
||||
cid TEXT NOT NULL,
|
||||
dst VARCHAR(66) NOT NULL,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE public.receipt_cids (
|
||||
id SERIAL PRIMARY KEY,
|
||||
tx_id INTEGER NOT NULL REFERENCES transaction_cids (id) ON DELETE CASCADE,
|
||||
tx_id INTEGER NOT NULL REFERENCES transaction_cids (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
|
||||
cid TEXT NOT NULL,
|
||||
topic0s VARCHAR(66)[]
|
||||
);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE public.state_cids (
|
||||
id SERIAL PRIMARY KEY,
|
||||
header_id INTEGER NOT NULL REFERENCES header_cids (id) ON DELETE CASCADE,
|
||||
header_id INTEGER NOT NULL REFERENCES header_cids (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
|
||||
state_key VARCHAR(66) NOT NULL,
|
||||
leaf BOOLEAN NOT NULL,
|
||||
cid TEXT NOT NULL,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE public.storage_cids (
|
||||
id SERIAL PRIMARY KEY,
|
||||
state_id INTEGER NOT NULL REFERENCES state_cids (id) ON DELETE CASCADE,
|
||||
state_id INTEGER NOT NULL REFERENCES state_cids (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
|
||||
storage_key VARCHAR(66) NOT NULL,
|
||||
leaf BOOLEAN NOT NULL,
|
||||
cid TEXT NOT NULL,
|
||||
|
||||
Reference in New Issue
Block a user