Skip to content

Commit

Permalink
Avoid overflows
Browse files Browse the repository at this point in the history
  • Loading branch information
kderme committed Jul 12, 2024
1 parent a93614d commit d21895f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions cardano-db/src/Cardano/Db/Schema.hs
Original file line number Diff line number Diff line change
Expand Up @@ -561,10 +561,10 @@ share
PoolStat
poolHashId PoolHashId noreference
epochNo Word64 sqltype=word31type
numberOfBlocks Word64 sqltype=word31type
numberOfDelegators Word64 sqltype=word31type
stake Word64 sqltype=word31type
votingPower Word64 Maybe sqltype=word31type
numberOfBlocks Word64 sqltype=word64type
numberOfDelegators Word64 sqltype=word64type
stake Word64 sqltype=word64type
votingPower Word64 Maybe sqltype=word64type

ExtraMigrations
token Text
Expand Down
10 changes: 5 additions & 5 deletions doc/schema.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Schema Documentation for cardano-db-sync

Schema version: 13.3.0.0 (from branch **kderme/prepare-release-13.3** which may not accurately reflect the version number)
**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.

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

### `tx_cbor`

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

### `extra_migrations`

Expand Down
2 changes: 1 addition & 1 deletion schema/migration-2-0041-20240711.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DECLARE
BEGIN
SELECT stage_two + 1 INTO next_version FROM schema_version ;
IF next_version = 41 THEN
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)' ;
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)' ;
-- Hand written SQL statements can be added here.
UPDATE schema_version SET stage_two = next_version ;
RAISE NOTICE 'DB has been migrated to stage_two version %', next_version ;
Expand Down

0 comments on commit d21895f

Please sign in to comment.