-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feat/enforce-chained-db-blocks
- Loading branch information
Showing
10 changed files
with
57 additions
and
31 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
...core-database-postgres/src/migrations/20190619000000-drop-id-column-from-rounds-table.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,2 @@ | ||
ALTER TABLE rounds DROP COLUMN id, ADD PRIMARY KEY (round, public_key); | ||
DROP INDEX rounds_unique; |
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
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
SELECT * | ||
FROM rounds | ||
ORDER BY id DESC LIMIT 1 | ||
ORDER BY round DESC, balance, public_key DESC | ||
LIMIT 1 |
12 changes: 6 additions & 6 deletions
12
packages/core-snapshots/src/db/queries/rounds/round-range.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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
SELECT | ||
id, | ||
public_key, | ||
round, | ||
balance, | ||
round | ||
public_key | ||
FROM | ||
rounds | ||
WHERE | ||
round BETWEEN ${startRound} AND ${endRound} AND | ||
id >= ${startId} | ||
round BETWEEN ${startRound} AND ${endRound} | ||
ORDER BY | ||
id | ||
round, balance DESC, public_key | ||
OFFSET | ||
${skipRoundRows} |
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
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
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