Skip to content

Commit

Permalink
Added indexes for public_api_daily_limit table
Browse files Browse the repository at this point in the history
  • Loading branch information
Camelia-Orcid committed Nov 18, 2024
1 parent 090b7b0 commit 87068ee
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions orcid-persistence/src/main/resources/db-master.xml
Original file line number Diff line number Diff line change
Expand Up @@ -406,4 +406,5 @@
<include file="/db/updates/add_unique_constraint_external_id_disambiguated_org.xml" />
<include file="/db/updates/add_date_verified_to_email.xml" />
<include file="/db/updates/create_public_api_daily_rate_limit.xml" />
<include file="/db/updates/add_public_api_daily_rate_limit_indexes.xml" />
</databaseChangeLog>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd">


<changeSet id="ADD-PAPI-LIMIT-INDEXES" author="Camelia Dumitru">
<preConditions onFail="MARK_RAN">
<not>
<indexExists indexName="idx_ip_address" tableName="public_api_daily_rate_limit" />
</not>
<not>
<indexExists indexName="idx_client_id" tableName="public_api_daily_rate_limit" />
</not>
<not>
<indexExists indexName="idx_request_date" tableName="public_api_daily_rate_limit" />
</not>
</preConditions>
<!-- Add indexes -->
<createIndex indexName="idx_ip_address" tableName="public_api_daily_rate_limit">
<column name="ip_address"/>
</createIndex>

<createIndex indexName="idx_client_id" tableName="public_api_daily_rate_limit">
<column name="client_id"/>
</createIndex>

<createIndex indexName="idx_request_date" tableName="public_api_daily_rate_limit">
<column name="request_date"/>
</createIndex>
</changeSet>

</databaseChangeLog>

0 comments on commit 87068ee

Please sign in to comment.