Skip to content

Commit 9a20727

Browse files
committed
ADD new schema.md
1 parent 5624471 commit 9a20727

File tree

2 files changed

+58
-15
lines changed

2 files changed

+58
-15
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1376,7 +1376,7 @@ schemaDocs =
13761376
OffChainVoteGovActionDataRationale # "The rationale"
13771377

13781378
OffChainVoteDrepData --^ do
1379-
"The table with offchain metadata for Drep Registrations. Implementes CIP-108. New in 13.3-Conway."
1379+
"The table with offchain metadata for Drep Registrations. Implementes CIP-119. New in 13.3-Conway."
13801380
OffChainVoteDrepDataOffChainVoteDataId # "The vote metadata table index this offchain data belongs to."
13811381
OffChainVoteDrepDataPaymentAddress # "The payment address"
13821382
OffChainVoteDrepDataGivenName # "The name. This is the only mandatory field"

doc/schema.md

Lines changed: 57 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ An on-chain pool update.
276276
| `meta_id` | integer (64) | The PoolMetadataRef table index this pool update refers to. |
277277
| `margin` | double | The margin (as a percentage) this pool charges. |
278278
| `fixed_cost` | lovelace | The fixed per epoch fee (in ADA) this pool charges. |
279-
| `deposit` | lovelace | |
279+
| `deposit` | lovelace | The deposit payed for this pool update. Null for reregistrations. |
280280
| `registered_tx_id` | integer (64) | The Tx table index of the transaction in which provided this pool update. |
281281

282282
### `pool_owner`
@@ -865,14 +865,14 @@ A table for every Anchor that appears on Governance Actions. These are pointers
865865
| Column name | Type | Description |
866866
|-|-|-|
867867
| `id` | integer (64) | |
868-
| `tx_id` | integer (64) | The Tx table index of the tx that includes this anchor. This only exists to facilitate rollbacks |
868+
| `block_id` | integer (64) | The Block table index of the tx that includes this anchor. This only exists to facilitate rollbacks |
869869
| `data_hash` | blob | A hash of the contents of the metadata URL |
870870
| `url` | varchar | A URL to a JSON payload of metadata |
871871
| `type` | anchorType | |
872872

873873
### `gov_action_proposal`
874874

875-
A table for proposed GovActionProposal, aka ProposalProcedure, GovAction or GovProposal. At most one of the ratified/enacted/dropped/expired epoch field can be non-null, indicating the current state of the proposal. This table may be referenced by TreasuryWithdrawal or NewCommittee. New in 13.2-Conway.
875+
A table for proposed GovActionProposal, aka ProposalProcedure, GovAction or GovProposal. This table may be referenced by TreasuryWithdrawal or NewCommittee. New in 13.2-Conway.
876876

877877
* Primary Id: `id`
878878

@@ -907,7 +907,7 @@ A table for all treasury withdrawals proposed on a GovActionProposal. New in 13.
907907
| `stake_address_id` | integer (64) | The address that benefits from this withdrawal. |
908908
| `amount` | lovelace | The amount for this withdrawl. |
909909

910-
### `new_committee_info`
910+
### `committee`
911911

912912
A table for new committee proposed on a GovActionProposal. New in 13.2-Conway.
913913

@@ -916,20 +916,22 @@ A table for new committee proposed on a GovActionProposal. New in 13.2-Conway.
916916
| Column name | Type | Description |
917917
|-|-|-|
918918
| `id` | integer (64) | |
919-
| `gov_action_proposal_id` | integer (64) | The GovActionProposal table index for this new committee. |
919+
| `gov_action_proposal_id` | integer (64) | The GovActionProposal table index for this new committee. This can be null for genesis committees. |
920920
| `quorum_numerator` | integer (64) | The proposed quorum nominator. |
921921
| `quorum_denominator` | integer (64) | The proposed quorum denominator. |
922922

923-
### `new_committee_member`
923+
### `committee_member`
924+
925+
A table for members of the committee. A committee can have multiple members. New in 13.3-Conway.
924926

925927
* Primary Id: `id`
926928

927929
| Column name | Type | Description |
928930
|-|-|-|
929931
| `id` | integer (64) | |
930-
| `gov_action_proposal_id` | integer (64) | |
931-
| `committee_hash_id` | integer (64) | |
932-
| `expiration_epoch` | word31type | |
932+
| `committee_id` | integer (64) | The reference to the committee |
933+
| `committee_hash_id` | integer (64) | The reference to the committee hash |
934+
| `expiration_epoch` | word31type | The epoch this member expires |
933935

934936
### `constitution`
935937

@@ -977,6 +979,18 @@ The table for the distribution of voting power per DRep per. Currently this has
977979
| `epoch_no` | word31type | The epoch no this distribution is about. |
978980
| `active_until` | word31type | The epoch until which this drep is active. TODO: This currently remains null always. |
979981

982+
### `epoch_state`
983+
984+
* Primary Id: `id`
985+
986+
| Column name | Type | Description |
987+
|-|-|-|
988+
| `id` | integer (64) | |
989+
| `committee_id` | integer (64) | |
990+
| `no_confidence_id` | integer (64) | |
991+
| `constitution_id` | integer (64) | |
992+
| `epoch_no` | word31type | |
993+
980994
### `off_chain_pool_data`
981995

982996
The pool offchain (ie not on chain) for a stake pool.
@@ -1020,16 +1034,45 @@ The table with the offchain metadata related to Vote Anchors. It accepts metadat
10201034
| `voting_anchor_id` | integer (64) | The VotingAnchor table index this offchain data refers. |
10211035
| `hash` | blob | The hash of the offchain data. |
10221036
| `language` | string | The langauge described in the context of the metadata. Described in CIP-100. New in 13.3-Conway. |
1023-
| `comment` | string | The title of the metadata. Described in CIP-108. New in 13.3-Conway. |
1024-
| `title` | string | |
1025-
| `abstract` | string | The abstract of the metadata. Described in CIP-108. New in 13.3-Conway. |
1026-
| `motivation` | string | The motivation of the metadata. Described in CIP-108. New in 13.3-Conway. |
1027-
| `rationale` | string | The rationale of the metadata. Described in CIP-108. New in 13.3-Conway. |
1037+
| `comment` | string | |
10281038
| `json` | jsonb | The payload as JSON. |
10291039
| `bytes` | bytea | The raw bytes of the payload. |
10301040
| `warning` | string | A warning that occured while validating the metadata. |
10311041
| `is_valid` | boolean | False if the data is found invalid. db-sync leaves this field null since it normally populates off_chain_vote_fetch_error for invalid data. It can be used manually to mark some metadata invalid by clients. |
10321042

1043+
### `off_chain_vote_gov_action_data`
1044+
1045+
The table with offchain metadata for Governance Actions. Implementes CIP-108. New in 13.3-Conway.
1046+
1047+
* Primary Id: `id`
1048+
1049+
| Column name | Type | Description |
1050+
|-|-|-|
1051+
| `id` | integer (64) | |
1052+
| `off_chain_vote_data_id` | integer (64) | The vote metadata table index this offchain data belongs to. |
1053+
| `title` | string | The title |
1054+
| `abstract` | string | The abstract |
1055+
| `motivation` | string | The motivation |
1056+
| `rationale` | string | The rationale |
1057+
1058+
### `off_chain_vote_drep_data`
1059+
1060+
The table with offchain metadata for Drep Registrations. Implementes CIP-119. New in 13.3-Conway.
1061+
1062+
* Primary Id: `id`
1063+
1064+
| Column name | Type | Description |
1065+
|-|-|-|
1066+
| `id` | integer (64) | |
1067+
| `off_chain_vote_data_id` | integer (64) | The vote metadata table index this offchain data belongs to. |
1068+
| `payment_address` | string | The payment address |
1069+
| `given_name` | string | The name. This is the only mandatory field |
1070+
| `objectives` | string | The objectives |
1071+
| `motivations` | string | The motivations |
1072+
| `qualifications` | string | The qualifications |
1073+
| `image_url` | string | |
1074+
| `image_hash` | string | |
1075+
10331076
### `off_chain_vote_author`
10341077

10351078
The table with offchain metadata authors, as decribed in CIP-100. New in 13.3-Conway.

0 commit comments

Comments
 (0)