From 2a2a18a163e12e1eaa659ed22eee8fafd5509af8 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Mon, 27 Jan 2020 13:07:32 -0800 Subject: [PATCH] Add candidate Signed-off-by: Jakub Sztandera --- cmd/lotus-chainwatch/storage.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cmd/lotus-chainwatch/storage.go b/cmd/lotus-chainwatch/storage.go index 20ce6ffcc..728b7f393 100644 --- a/cmd/lotus-chainwatch/storage.go +++ b/cmd/lotus-chainwatch/storage.go @@ -313,6 +313,7 @@ create table if not exists blocks_challenges index bigint not null, sector_id bigint not null, partial bytea not null, + candidate bigint not null, constraint blocks_challenges_pk unique (block, index) ); @@ -320,9 +321,15 @@ create table if not exists blocks_challenges create index if not exists blocks_challenges_block_index on blocks_challenges (block); +create index if not exists blocks_challenges_block_candidate_index + on blocks_challenges (block,candidate); + create index if not exists blocks_challenges_block_index_index on blocks_challenges (block, index); +create index if not exists blocks_challenges_candidate_index + on blocks_challenges (candidate); + create index if not exists blocks_challenges_index_index on blocks_challenges (index); @@ -589,7 +596,7 @@ create temp table c (like blocks_challenges excluding constraints) on commit dro return xerrors.Errorf("blk put: %w", err) } - stmt3, err := tx.Prepare(`copy c (block, index, sector_id, partial) from stdin`) + stmt3, err := tx.Prepare(`copy c (block, index, sector_id, partial, candidate) from stdin`) if err != nil { return xerrors.Errorf("s3 create: %w", err) }