Skip to content

Commit d21895f

Browse files
committed
Avoid overflows
1 parent a93614d commit d21895f

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

cardano-db/src/Cardano/Db/Schema.hs

+4-4
Original file line numberDiff line numberDiff line change
@@ -561,10 +561,10 @@ share
561561
PoolStat
562562
poolHashId PoolHashId noreference
563563
epochNo Word64 sqltype=word31type
564-
numberOfBlocks Word64 sqltype=word31type
565-
numberOfDelegators Word64 sqltype=word31type
566-
stake Word64 sqltype=word31type
567-
votingPower Word64 Maybe sqltype=word31type
564+
numberOfBlocks Word64 sqltype=word64type
565+
numberOfDelegators Word64 sqltype=word64type
566+
stake Word64 sqltype=word64type
567+
votingPower Word64 Maybe sqltype=word64type
568568

569569
ExtraMigrations
570570
token Text

doc/schema.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Schema Documentation for cardano-db-sync
22

3-
Schema version: 13.3.0.0 (from branch **kderme/prepare-release-13.3** which may not accurately reflect the version number)
43
**Note:** This file is auto-generated from the documentation in cardano-db/src/Cardano/Db/Schema.hs by the command `cabal run -- gen-schema-docs doc/schema.md`. This document should only be updated during the release process and updated on the release branch.
54

65
### `schema_version`
@@ -86,6 +85,7 @@ A table for transactions within a block on the chain.
8685
| `invalid_hereafter` | word64type | Transaction in invalid at or after this slot number. |
8786
| `valid_contract` | boolean | False if the contract is invalid. True if the contract is valid or there is no contract. |
8887
| `script_size` | word31type | The sum of the script sizes (in bytes) of scripts in the transaction. |
88+
| `treasury_donation` | lovelace | |
8989

9090
### `tx_cbor`
9191

@@ -785,10 +785,10 @@ Stats per pool and per epoch.
785785
| `id` | integer (64) | |
786786
| `pool_hash_id` | integer (64) | The pool_hash_id reference. |
787787
| `epoch_no` | word31type | The epoch number. |
788-
| `number_of_blocks` | word31type | Number of blocks created on the previous epoch. |
789-
| `number_of_delegators` | word31type | Number of delegators in the mark snapshot. |
790-
| `stake` | word31type | Total stake in the mark snapshot. |
791-
| `voting_power` | word31type | Voting power of the SPO. |
788+
| `number_of_blocks` | word64type | Number of blocks created on the previous epoch. |
789+
| `number_of_delegators` | word64type | Number of delegators in the mark snapshot. |
790+
| `stake` | word64type | Total stake in the mark snapshot. |
791+
| `voting_power` | word64type | Voting power of the SPO. |
792792

793793
### `extra_migrations`
794794

schema/migration-2-0041-20240711.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ DECLARE
66
BEGIN
77
SELECT stage_two + 1 INTO next_version FROM schema_version ;
88
IF next_version = 41 THEN
9-
EXECUTE 'CREATe TABLE "pool_stat"("id" SERIAL8 PRIMARY KEY UNIQUE,"pool_hash_id" INT8 NOT NULL,"epoch_no" word31type NOT NULL,"number_of_blocks" word31type NOT NULL,"number_of_delegators" word31type NOT NULL,"stake" word31type NOT NULL,"voting_power" word31type NULL)' ;
9+
EXECUTE 'CREATe TABLE "pool_stat"("id" SERIAL8 PRIMARY KEY UNIQUE,"pool_hash_id" INT8 NOT NULL,"epoch_no" word31type NOT NULL,"number_of_blocks" word64type NOT NULL,"number_of_delegators" word64type NOT NULL,"stake" word64type NOT NULL,"voting_power" word64type NULL)' ;
1010
-- Hand written SQL statements can be added here.
1111
UPDATE schema_version SET stage_two = next_version ;
1212
RAISE NOTICE 'DB has been migrated to stage_two version %', next_version ;

0 commit comments

Comments
 (0)