-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Grandine support * Fix line wrapping
- Loading branch information
1 parent
02c9f80
commit 2910089
Showing
4 changed files
with
46 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Database Migrations | ||
|
||
When the database schema changes, manual intervention is required to update existing databases. | ||
|
||
You should apply each of the migrations in `blockprint/migrations` in order, like so: | ||
|
||
``` | ||
sqlite3 block_db.sqlite ".read migrations/00_pr_grandine.sql" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
ALTER TABLE blocks RENAME TO blocks_legacy; | ||
|
||
CREATE TABLE blocks ( | ||
slot INT, | ||
parent_slot INTEGER, | ||
proposer_index INT, | ||
best_guess_single TEXT, | ||
best_guess_multi TEXT, | ||
pr_grandine FLOAT DEFAULT 0.0, | ||
pr_lighthouse FLOAT, | ||
pr_lodestar FLOAT, | ||
pr_nimbus FLOAT, | ||
pr_prysm FLOAT, | ||
pr_teku FLOAT, | ||
graffiti_guess TEXT, | ||
UNIQUE(slot, proposer_index) | ||
); | ||
|
||
INSERT INTO | ||
blocks(slot, parent_slot, proposer_index, best_guess_single, best_guess_multi, | ||
pr_lighthouse, pr_lodestar, pr_nimbus, pr_prysm, pr_teku, graffiti_guess) | ||
SELECT slot, parent_slot, proposer_index, best_guess_single, best_guess_multi, | ||
pr_lighthouse, pr_lodestar, pr_nimbus, pr_prysm, pr_teku, graffiti_guess | ||
FROM blocks_legacy; | ||
|
||
DROP TABLE blocks_legacy; | ||
|
||
VACUUM; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters