From b9826396b7d4c2f96acd3b2107c7fb214b19daa0 Mon Sep 17 00:00:00 2001 From: Thomas Kammerlocher Date: Wed, 11 Sep 2024 10:57:08 +0200 Subject: [PATCH] feat: adding new conway tables --- .../default/tables/public_DelegationVote.yaml | 45 ++++++++++++++ .../tables/public_DrepRegistration.yaml | 28 +++++++++ .../default/tables/public_Transaction.yaml | 1 + .../default/tables/public_committee_hash.yaml | 3 + .../default/tables/public_drep_hash.yaml | 3 + .../tables/public_gov_action_proposal.yaml | 35 +++++++++++ .../tables/public_off_chain_vote_data.yaml | 3 + .../default/tables/public_pool_hash.yaml | 3 + .../default/tables/public_pool_stat.yaml | 3 + .../databases/default/tables/public_tx.yaml | 3 + .../default/tables/public_voting_anchor.yaml | 13 ++++ .../tables/public_voting_procedure.yaml | 59 +++++++++++++++++++ .../databases/default/tables/tables.yaml | 11 ++++ .../default/1589369664961_init/down.sql | 58 +++++++++--------- 14 files changed, 240 insertions(+), 28 deletions(-) create mode 100644 packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_DelegationVote.yaml create mode 100644 packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_DrepRegistration.yaml create mode 100644 packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_committee_hash.yaml create mode 100644 packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_drep_hash.yaml create mode 100644 packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_gov_action_proposal.yaml create mode 100644 packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_off_chain_vote_data.yaml create mode 100644 packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_pool_hash.yaml create mode 100644 packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_pool_stat.yaml create mode 100644 packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_tx.yaml create mode 100644 packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_voting_anchor.yaml create mode 100644 packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_voting_procedure.yaml diff --git a/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_DelegationVote.yaml b/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_DelegationVote.yaml new file mode 100644 index 00000000..5819effd --- /dev/null +++ b/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_DelegationVote.yaml @@ -0,0 +1,45 @@ +table: + name: DelegationVote + schema: public +configuration: + column_config: {} + custom_column_names: {} + custom_root_fields: + select: delegationvotes + select_aggregate: delegationvotes_aggregate +object_relationships: + - name: redeemer + using: + manual_configuration: + column_mapping: + redeemerId: id + insertion_order: null + remote_table: + name: Redeemer + schema: public + - name: drep + using: + manual_configuration: + column_mapping: + drep_hash_id: id + insertion_order: null + remote_table: + name: drep_hash + schema: public + - name: transaction + using: + manual_configuration: + column_mapping: + tx_id: id + insertion_order: null + remote_table: + name: Transaction + schema: public +select_permissions: + - role: cardano-graphql + permission: + columns: + - address + filter: {} + limit: 2500 + allow_aggregations: true diff --git a/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_DrepRegistration.yaml b/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_DrepRegistration.yaml new file mode 100644 index 00000000..760adc4d --- /dev/null +++ b/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_DrepRegistration.yaml @@ -0,0 +1,28 @@ +table: + name: DrepRegistration + schema: public +configuration: + column_config: {} + custom_column_names: {} + custom_root_fields: + select: drepRegistrations + select_aggregate: drepRegistrations_aggregate +object_relationships: + - name: transaction + using: + manual_configuration: + column_mapping: + tx_id: id + insertion_order: null + remote_table: + name: Transaction + schema: public + - name: votingAnchor + using: + manual_configuration: + column_mapping: + voting_anchor_id: id + insertion_order: null + remote_table: + name: voting_anchor + schema: public \ No newline at end of file diff --git a/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_Transaction.yaml b/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_Transaction.yaml index bfbf8e0a..d18436f3 100644 --- a/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_Transaction.yaml +++ b/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_Transaction.yaml @@ -124,6 +124,7 @@ select_permissions: - size - totalOutput - validContract + - treasuryDonation filter: {} limit: 2500 allow_aggregations: true diff --git a/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_committee_hash.yaml b/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_committee_hash.yaml new file mode 100644 index 00000000..ea5ef408 --- /dev/null +++ b/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_committee_hash.yaml @@ -0,0 +1,3 @@ +table: + name: committee_hash + schema: public diff --git a/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_drep_hash.yaml b/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_drep_hash.yaml new file mode 100644 index 00000000..310706cb --- /dev/null +++ b/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_drep_hash.yaml @@ -0,0 +1,3 @@ +table: + name: drep_hash + schema: public diff --git a/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_gov_action_proposal.yaml b/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_gov_action_proposal.yaml new file mode 100644 index 00000000..5c81e194 --- /dev/null +++ b/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_gov_action_proposal.yaml @@ -0,0 +1,35 @@ +table: + name: gov_action_proposal + schema: public +configuration: + column_config: {} + custom_column_names: {} + custom_root_fields: + select: gov_action_proposal + select_aggregate: gov_action_proposal_aggregate +object_relationships: + - name: transaction + using: + manual_configuration: + column_mapping: + tx_id: id + insertion_order: null + remote_table: + name: tx + schema: public + - name: PreviousGovAction + using: + manual_configuration: + column_mapping: + prev_gov_action_proposal: id + remote_table: + name: gov_action_proposal + schema: public + - name: VotingAnchor + using: + manual_configuration: + column_mapping: + voting_anchor_id: id + remote_table: + name: voting_anchor + schema: public \ No newline at end of file diff --git a/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_off_chain_vote_data.yaml b/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_off_chain_vote_data.yaml new file mode 100644 index 00000000..203d37fb --- /dev/null +++ b/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_off_chain_vote_data.yaml @@ -0,0 +1,3 @@ +table: + name: off_chain_vote_data + schema: public \ No newline at end of file diff --git a/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_pool_hash.yaml b/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_pool_hash.yaml new file mode 100644 index 00000000..c604ace3 --- /dev/null +++ b/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_pool_hash.yaml @@ -0,0 +1,3 @@ +table: + name: pool_hash + schema: public diff --git a/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_pool_stat.yaml b/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_pool_stat.yaml new file mode 100644 index 00000000..c6580b89 --- /dev/null +++ b/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_pool_stat.yaml @@ -0,0 +1,3 @@ +table: + name: pool_stat + schema: public \ No newline at end of file diff --git a/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_tx.yaml b/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_tx.yaml new file mode 100644 index 00000000..a25aec19 --- /dev/null +++ b/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_tx.yaml @@ -0,0 +1,3 @@ +table: + name: tx + schema: public \ No newline at end of file diff --git a/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_voting_anchor.yaml b/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_voting_anchor.yaml new file mode 100644 index 00000000..da2ac99c --- /dev/null +++ b/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_voting_anchor.yaml @@ -0,0 +1,13 @@ +table: + name: voting_anchor + schema: public +object_relationships: + - name: OffChainData + using: + manual_configuration: + column_mapping: + id: voting_anchor_id + insertion_order: null + remote_table: + name: off_chain_vote_data + schema: public diff --git a/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_voting_procedure.yaml b/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_voting_procedure.yaml new file mode 100644 index 00000000..be6da8a1 --- /dev/null +++ b/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_voting_procedure.yaml @@ -0,0 +1,59 @@ +table: + name: voting_procedure + schema: public +configuration: + column_config: {} + custom_column_names: {} + custom_root_fields: + select: vote_procedure + select_aggregate: vote_procedure_aggregate +object_relationships: + - name: transaction + using: + manual_configuration: + column_mapping: + tx_id: id + insertion_order: null + remote_table: + name: tx + schema: public + - name: GovActionProposal + using: + manual_configuration: + column_mapping: + gov_action_proposal_id: id + remote_table: + name: gov_action_proposal + schema: public + - name: DrepVoter + using: + manual_configuration: + column_mapping: + drep_voter: id + remote_table: + name: drep_hash + schema: public + - name: PoolVoter + using: + manual_configuration: + column_mapping: + pool_voter: id + remote_table: + name: pool_hash + schema: public + - name: VotingAnchor + using: + manual_configuration: + column_mapping: + voting_anchor_id: id + remote_table: + name: voting_anchor + schema: public + - name: CommitteeVoter + using: + manual_configuration: + column_mapping: + committee_voter: id + remote_table: + name: committee_hash + schema: public \ No newline at end of file diff --git a/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/tables.yaml b/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/tables.yaml index f46f1632..957d6a77 100644 --- a/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/tables.yaml +++ b/packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/tables.yaml @@ -31,3 +31,14 @@ - "!include public_pool_relay.yaml" - "!include public_reserve.yaml" - "!include public_tx_metadata.yaml" +- "!include public_tx.yaml" +- "!include public_pool_stat.yaml" +- "!include public_DelegationVote.yaml" +- "!include public_DrepRegistration.yaml" +- "!include public_drep_hash.yaml" +- "!include public_voting_anchor.yaml" +- "!include public_voting_procedure.yaml" +- "!include public_gov_action_proposal.yaml" +- "!include public_committee_hash.yaml" +- "!include public_pool_hash.yaml" +- "!include public_off_chain_vote_data.yaml" \ No newline at end of file diff --git a/packages/api-cardano-db-hasura/hasura/project/migrations/default/1589369664961_init/down.sql b/packages/api-cardano-db-hasura/hasura/project/migrations/default/1589369664961_init/down.sql index 3203c943..04a11412 100644 --- a/packages/api-cardano-db-hasura/hasura/project/migrations/default/1589369664961_init/down.sql +++ b/packages/api-cardano-db-hasura/hasura/project/migrations/default/1589369664961_init/down.sql @@ -1,29 +1,31 @@ DROP VIEW IF EXISTS - "AdaPots", - "ActiveStake", - "Block", - "Cardano", - "CollateralInput", - "CollateralOutput", - "Datum", - "Delegation", - "Epoch", - "ProtocolParams", - "Redeemer", - "RedeemerDatum", - "ReferenceInput", - "Reward", - "Script", - "SlotLeader", - "StakeDeregistration", - "StakePool", - "StakePoolOwner", - "StakeRegistration", - "StakePoolRetirement", - "TokenMint", - "TokenInOutput", - "Transaction", - "TransactionInput", - "TransactionOutput", - "Utxo", - "Withdrawal" CASCADE; +"AdaPots", +"ActiveStake", +"Block", +"Cardano", +"CollateralInput", +"CollateralOutput", +"Datum", +"Delegation", +"Epoch", +"ProtocolParams", +"Redeemer", +"RedeemerDatum", +"ReferenceInput", +"Reward", +"Script", +"SlotLeader", +"StakeDeregistration", +"StakePool", +"StakePoolOwner", +"StakeRegistration", +"StakePoolRetirement", +"TokenMint", +"TokenInOutput", +"Transaction", +"TransactionInput", +"TransactionOutput", +"Utxo", +"Withdrawal", +"DelegationVote", +"DrepRegistration" CASCADE;