Skip to content

Commit

Permalink
chore: #313 [governance] Add optional indexes to drop_index/create_in…
Browse files Browse the repository at this point in the history
…dex script
  • Loading branch information
Sotatek-HuyLe3a committed Jul 16, 2024
1 parent 6e3315d commit ff4c9a4
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 0 deletions.
24 changes: 24 additions & 0 deletions applications/all/src/main/resources/sql/create-index.sql
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,27 @@ CREATE INDEX if not exists idx_txn_metadata_label
CREATE INDEX if not exists idx_txn_scripts_tx_hash
ON transaction_scripts (tx_hash);

-- governance
CREATE INDEX idx_gov_action_proposal_txhash
ON gov_action_proposal (tx_hash);

CREATE INDEX idx_gov_action_proposal_return_address
ON gov_action_proposal (return_address);

CREATE INDEX idx_gov_action_proposal_type
ON gov_action_proposal (type);

CREATE INDEX idx_voting_procedure_txhash
ON voting_procedure (tx_hash);

CREATE INDEX idx_voting_procedure_gov_action_tx_hash
ON voting_procedure (gov_action_tx_hash);

CREATE INDEX idx_voting_procedure_gov_action_tx_hash_gov_action_index
ON voting_procedure (gov_action_tx_hash, gov_action_index);

CREATE INDEX idx_delegation_vote_address
ON delegation_vote (address);

CREATE INDEX idx_delegation_vote_drep_id
ON delegation_vote (drep_id);
10 changes: 10 additions & 0 deletions applications/all/src/main/resources/sql/drop-index.sql
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,13 @@ drop index idx_txn_metadata_label;

-- scripts
drop index idx_txn_scripts_tx_hash;

-- governance
drop index idx_gov_action_proposal_txhash;
drop index idx_gov_action_proposal_return_address;
drop index idx_gov_action_proposal_type;
drop index idx_voting_procedure_txhash;
drop index idx_voting_procedure_gov_action_tx_hash;
drop index idx_voting_procedure_gov_action_tx_hash_gov_action_index;
drop index idx_delegation_vote_address;
drop index idx_delegation_vote_drep_id;
25 changes: 25 additions & 0 deletions applications/all/src/main/resources/sql/mysql/create-index.sql
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,28 @@ CREATE INDEX idx_txn_metadata_label

CREATE INDEX idx_txn_scripts_tx_hash
ON transaction_scripts (tx_hash);

-- governance
CREATE INDEX idx_gov_action_proposal_txhash
ON gov_action_proposal (tx_hash);

CREATE INDEX idx_gov_action_proposal_return_address
ON gov_action_proposal (return_address);

CREATE INDEX idx_gov_action_proposal_type
ON gov_action_proposal (type);

CREATE INDEX idx_voting_procedure_txhash
ON voting_procedure (tx_hash);

CREATE INDEX idx_voting_procedure_gov_action_tx_hash
ON voting_procedure (gov_action_tx_hash);

CREATE INDEX idx_voting_procedure_gov_action_tx_hash_gov_action_index
ON voting_procedure (gov_action_tx_hash, gov_action_index);

CREATE INDEX idx_delegation_vote_address
ON delegation_vote (address);

CREATE INDEX idx_delegation_vote_drep_id
ON delegation_vote (drep_id);
10 changes: 10 additions & 0 deletions applications/all/src/main/resources/sql/mysql/drop-index.sql
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,13 @@ drop index idx_txn_metadata_label on transaction_metadata;

-- scripts
drop index idx_txn_scripts_tx_hash on transaction_scripts;

-- governance
drop index idx_gov_action_proposal_txhash on gov_action_proposal;
drop index idx_gov_action_proposal_return_address on gov_action_proposal;
drop index idx_gov_action_proposal_type on gov_action_proposal;
drop index idx_voting_procedure_txhash on voting_procedure;
drop index idx_voting_procedure_gov_action_tx_hash on voting_procedure;
drop index idx_voting_procedure_gov_action_tx_hash_gov_action_index on voting_procedure;
drop index idx_delegation_vote_address on delegation_vote;
drop index idx_delegation_vote_drep_id on delegation_vote;

0 comments on commit ff4c9a4

Please sign in to comment.