clean up - can rm type here

This commit is contained in:
Roy Crihfield 2022-02-15 18:41:31 +08:00
parent c4b4f232e9
commit 73cc0f191b

View File

@ -3,8 +3,8 @@ package types
var TableIPLDBlock = Table{ var TableIPLDBlock = Table{
`public.blocks`, `public.blocks`,
[]column{ []column{
column{"key", text}, {"key", text},
column{"data", bytea}, {"data", bytea},
}, },
`ON CONFLICT (key) DO NOTHING`, `ON CONFLICT (key) DO NOTHING`,
} }
@ -12,33 +12,33 @@ var TableIPLDBlock = Table{
var TableNodeInfo = Table{ var TableNodeInfo = Table{
Name: `public.nodes`, Name: `public.nodes`,
Columns: []column{ Columns: []column{
column{"genesis_block", varchar}, {"genesis_block", varchar},
column{"network_id", varchar}, {"network_id", varchar},
column{"node_id", varchar}, {"node_id", varchar},
column{"client_name", varchar}, {"client_name", varchar},
column{"chain_id", integer}, {"chain_id", integer},
}, },
} }
var TableHeader = Table{ var TableHeader = Table{
"eth.header_cids", "eth.header_cids",
[]column{ []column{
column{"block_number", bigint}, {"block_number", bigint},
column{"block_hash", varchar}, {"block_hash", varchar},
column{"parent_hash", varchar}, {"parent_hash", varchar},
column{"cid", text}, {"cid", text},
column{"td", numeric}, {"td", numeric},
column{"node_id", varchar}, {"node_id", varchar},
column{"reward", numeric}, {"reward", numeric},
column{"state_root", varchar}, {"state_root", varchar},
column{"tx_root", varchar}, {"tx_root", varchar},
column{"receipt_root", varchar}, {"receipt_root", varchar},
column{"uncle_root", varchar}, {"uncle_root", varchar},
column{"bloom", bytea}, {"bloom", bytea},
column{"timestamp", numeric}, {"timestamp", numeric},
column{"mh_key", text}, {"mh_key", text},
column{"times_validated", integer}, {"times_validated", integer},
column{"coinbase", varchar}, {"coinbase", varchar},
}, },
"ON CONFLICT (block_hash) DO UPDATE SET (parent_hash, cid, td, node_id, reward, state_root, tx_root, receipt_root, uncle_root, bloom, timestamp, mh_key, times_validated, coinbase) = (EXCLUDED.parent_hash, EXCLUDED.cid, EXCLUDED.td, EXCLUDED.node_id, EXCLUDED.reward, EXCLUDED.state_root, EXCLUDED.tx_root, EXCLUDED.receipt_root, EXCLUDED.uncle_root, EXCLUDED.bloom, EXCLUDED.timestamp, EXCLUDED.mh_key, eth.header_cids.times_validated + 1, EXCLUDED.coinbase)", "ON CONFLICT (block_hash) DO UPDATE SET (parent_hash, cid, td, node_id, reward, state_root, tx_root, receipt_root, uncle_root, bloom, timestamp, mh_key, times_validated, coinbase) = (EXCLUDED.parent_hash, EXCLUDED.cid, EXCLUDED.td, EXCLUDED.node_id, EXCLUDED.reward, EXCLUDED.state_root, EXCLUDED.tx_root, EXCLUDED.receipt_root, EXCLUDED.uncle_root, EXCLUDED.bloom, EXCLUDED.timestamp, EXCLUDED.mh_key, eth.header_cids.times_validated + 1, EXCLUDED.coinbase)",
} }
@ -46,13 +46,13 @@ var TableHeader = Table{
var TableStateNode = Table{ var TableStateNode = Table{
"eth.state_cids", "eth.state_cids",
[]column{ []column{
column{"header_id", varchar}, {"header_id", varchar},
column{"state_leaf_key", varchar}, {"state_leaf_key", varchar},
column{"cid", text}, {"cid", text},
column{"state_path", bytea}, {"state_path", bytea},
column{"node_type", integer}, {"node_type", integer},
column{"diff", boolean}, {"diff", boolean},
column{"mh_key", text}, {"mh_key", text},
}, },
`ON CONFLICT (header_id, state_path) DO UPDATE SET (state_leaf_key, cid, node_type, diff, mh_key) = (EXCLUDED.state_leaf_key, EXCLUDED.cid, EXCLUDED.node_type, EXCLUDED.diff, EXCLUDED.mh_key)`, `ON CONFLICT (header_id, state_path) DO UPDATE SET (state_leaf_key, cid, node_type, diff, mh_key) = (EXCLUDED.state_leaf_key, EXCLUDED.cid, EXCLUDED.node_type, EXCLUDED.diff, EXCLUDED.mh_key)`,
} }
@ -60,14 +60,14 @@ var TableStateNode = Table{
var TableStorageNode = Table{ var TableStorageNode = Table{
"eth.storage_cids", "eth.storage_cids",
[]column{ []column{
column{"header_id", varchar}, {"header_id", varchar},
column{"state_path", bytea}, {"state_path", bytea},
column{"storage_leaf_key", varchar}, {"storage_leaf_key", varchar},
column{"cid", text}, {"cid", text},
column{"storage_path", bytea}, {"storage_path", bytea},
column{"node_type", integer}, {"node_type", integer},
column{"diff", boolean}, {"diff", boolean},
column{"mh_key", text}, {"mh_key", text},
}, },
"ON CONFLICT (header_id, state_path, storage_path) DO UPDATE SET (storage_leaf_key, cid, node_type, diff, mh_key) = (EXCLUDED.storage_leaf_key, EXCLUDED.cid, EXCLUDED.node_type, EXCLUDED.diff, EXCLUDED.mh_key)", "ON CONFLICT (header_id, state_path, storage_path) DO UPDATE SET (storage_leaf_key, cid, node_type, diff, mh_key) = (EXCLUDED.storage_leaf_key, EXCLUDED.cid, EXCLUDED.node_type, EXCLUDED.diff, EXCLUDED.mh_key)",
} }