Add candidate

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
Jakub Sztandera 2020-01-27 13:07:32 -08:00
parent 29f3d6aa28
commit 2a2a18a163
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA

View File

@ -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)
}