Skip to content

Commit

Permalink
fix(db): Make snapshot_recovery migration backward-compatible (#961)
Browse files Browse the repository at this point in the history
## What ❔

Creates a new DB migration that restores removed snapshot_recovery
columns.

## Why ❔

Having non-backward-compatible change leads to potential breaks on
various environments.

## Checklist

- [x] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
  • Loading branch information
slowli authored Jan 29, 2024
1 parent 7334679 commit e756762
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE snapshot_recovery
DROP COLUMN IF EXISTS last_finished_chunk_id,
DROP COLUMN IF EXISTS total_chunk_count;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- Temporary revert of the previous `snapshot_recovery` so that the migration is backward-compatible.
-- Do not use these columns in code.
ALTER TABLE snapshot_recovery
ADD COLUMN IF NOT EXISTS last_finished_chunk_id INT,
ADD COLUMN IF NOT EXISTS total_chunk_count INT NOT NULL DEFAULT 0;

0 comments on commit e756762

Please sign in to comment.