mirror of
https://github.com/scroll-tech/scroll.git
synced 2026-01-14 08:28:02 -05:00
Co-authored-by: georgehao <georgehao@users.noreply.github.com> Co-authored-by: Péter Garamvölgyi <peter@scroll.io> Co-authored-by: colin <102356659+colinlyguo@users.noreply.github.com> Co-authored-by: colinlyguo <colinlyguo@scroll.io> Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
29 lines
911 B
SQL
29 lines
911 B
SQL
-- +goose Up
|
|
-- +goose StatementBegin
|
|
|
|
ALTER TABLE chunk
|
|
ADD COLUMN total_attempts SMALLINT NOT NULL DEFAULT 0,
|
|
ADD COLUMN active_attempts SMALLINT NOT NULL DEFAULT 0;
|
|
|
|
ALTER TABLE batch
|
|
ADD COLUMN total_attempts SMALLINT NOT NULL DEFAULT 0,
|
|
ADD COLUMN active_attempts SMALLINT NOT NULL DEFAULT 0;
|
|
|
|
create index if not exists idx_total_attempts_active_attempts_end_block_number
|
|
on chunk (total_attempts, active_attempts, end_block_number)
|
|
where deleted_at IS NULL;
|
|
|
|
create index if not exists idx_total_attempts_active_attempts_chunk_proofs_status
|
|
on batch (total_attempts, active_attempts, chunk_proofs_status)
|
|
where deleted_at IS NULL;
|
|
|
|
-- +goose StatementEnd
|
|
|
|
-- +goose Down
|
|
-- +goose StatementBegin
|
|
|
|
drop index if exists idx_total_attempts_active_attempts_end_block_number;
|
|
drop index if exists idx_total_attempts_active_attempts_chunk_proofs_status;
|
|
|
|
-- +goose StatementEnd
|