This is an automated email from the ASF dual-hosted git repository.

adamsaghy pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git


The following commit(s) were added to refs/heads/develop by this push:
     new 3cef64f3cf FINERACT-2181: Add missing indexes (with check and 
concurrently)
3cef64f3cf is described below

commit 3cef64f3cf32ca94609f92f21e3c8185ab32dd4b
Author: Adam Saghy <[email protected]>
AuthorDate: Tue Jun 10 10:45:50 2025 +0200

    FINERACT-2181: Add missing indexes (with check and concurrently)
---
 .../module/loan/parts/1028_add_missing_indexes.xml | 92 +++++++++++++++++++++-
 1 file changed, 91 insertions(+), 1 deletion(-)

diff --git 
a/fineract-loan/src/main/resources/db/changelog/tenant/module/loan/parts/1028_add_missing_indexes.xml
 
b/fineract-loan/src/main/resources/db/changelog/tenant/module/loan/parts/1028_add_missing_indexes.xml
index 9d3eeef2b6..e952695914 100644
--- 
a/fineract-loan/src/main/resources/db/changelog/tenant/module/loan/parts/1028_add_missing_indexes.xml
+++ 
b/fineract-loan/src/main/resources/db/changelog/tenant/module/loan/parts/1028_add_missing_indexes.xml
@@ -22,19 +22,109 @@
 <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-4.3.xsd";>
-    <changeSet author="fineract" id="1">
+
+    <changeSet author="fineract" id="1-postgres" context="postgresql" 
runInTransaction="false">
+        <preConditions onFail="MARK_RAN">
+            <not>
+                <indexExists 
indexName="m_loan_transaction_transaction_type_enum_index"/>
+            </not>
+        </preConditions>
+        <sql>
+            CREATE INDEX CONCURRENTLY 
m_loan_transaction_transaction_type_enum_index
+                ON m_loan_transaction (transaction_type_enum);
+        </sql>
+    </changeSet>
+    <changeSet author="fineract" id="2-postgres" context="postgresql" 
runInTransaction="false">
+        <preConditions onFail="MARK_RAN">
+            <not>
+                <indexExists 
indexName="m_loan_transaction_transaction_date_index"/>
+            </not>
+        </preConditions>
+        <sql>
+            CREATE INDEX CONCURRENTLY m_loan_transaction_transaction_date_index
+                ON m_loan_transaction (transaction_date);
+        </sql>
+    </changeSet>
+    <changeSet author="fineract" id="3-postgres" context="postgresql" 
runInTransaction="false">
+        <preConditions onFail="MARK_RAN">
+            <not>
+                <indexExists 
indexName="m_loan_transaction_created_on_utc_index"/>
+            </not>
+        </preConditions>
+        <sql>
+            CREATE INDEX CONCURRENTLY m_loan_transaction_created_on_utc_index
+                ON m_loan_transaction (created_on_utc);
+        </sql>
+    </changeSet>
+    <changeSet author="fineract" id="4-postgres" context="postgresql" 
runInTransaction="false">
+        <preConditions onFail="MARK_RAN">
+            <not>
+                <indexExists indexName="m_loan_transaction_is_reversed_index"/>
+            </not>
+        </preConditions>
+        <sql>
+            CREATE INDEX CONCURRENTLY m_loan_transaction_is_reversed_index
+                ON m_loan_transaction (is_reversed);
+        </sql>
+    </changeSet>
+    <changeSet author="fineract" id="5-postgres" context="postgresql" 
runInTransaction="false">
+        <preConditions onFail="MARK_RAN">
+            <not>
+                <indexExists 
indexName="m_loan_transaction_submitted_on_date_index"/>
+            </not>
+        </preConditions>
+        <sql>
+            CREATE INDEX CONCURRENTLY 
m_loan_transaction_submitted_on_date_index
+                ON m_loan_transaction (submitted_on_date);
+        </sql>
+    </changeSet>
+
+    <changeSet author="fineract" id="1-mysql" context="mysql">
+        <preConditions onFail="MARK_RAN">
+            <not>
+                <indexExists 
indexName="m_loan_transaction_transaction_type_enum_index"/>
+            </not>
+        </preConditions>
         <createIndex 
indexName="m_loan_transaction_transaction_type_enum_index" 
tableName="m_loan_transaction">
             <column name="transaction_type_enum"/>
         </createIndex>
+    </changeSet>
+    <changeSet author="fineract" id="2-mysql" context="postgresql" 
runInTransaction="false">
+        <preConditions onFail="MARK_RAN">
+            <not>
+                <indexExists 
indexName="m_loan_transaction_transaction_date_index"/>
+            </not>
+        </preConditions>
         <createIndex indexName="m_loan_transaction_transaction_date_index" 
tableName="m_loan_transaction">
             <column name="transaction_date"/>
         </createIndex>
+    </changeSet>
+    <changeSet author="fineract" id="3-mysql" context="postgresql" 
runInTransaction="false">
+        <preConditions onFail="MARK_RAN">
+            <not>
+                <indexExists 
indexName="m_loan_transaction_created_on_utc_index"/>
+            </not>
+        </preConditions>
         <createIndex indexName="m_loan_transaction_created_on_utc_index" 
tableName="m_loan_transaction">
             <column name="created_on_utc"/>
         </createIndex>
+    </changeSet>
+    <changeSet author="fineract" id="4-mysql" context="postgresql" 
runInTransaction="false">
+        <preConditions onFail="MARK_RAN">
+            <not>
+                <indexExists indexName="m_loan_transaction_is_reversed_index"/>
+            </not>
+        </preConditions>
         <createIndex indexName="m_loan_transaction_is_reversed_index" 
tableName="m_loan_transaction">
             <column name="is_reversed"/>
         </createIndex>
+    </changeSet>
+    <changeSet author="fineract" id="5-mysql" context="postgresql" 
runInTransaction="false">
+        <preConditions onFail="MARK_RAN">
+            <not>
+                <indexExists 
indexName="m_loan_transaction_submitted_on_date_index"/>
+            </not>
+        </preConditions>
         <createIndex indexName="m_loan_transaction_submitted_on_date_index" 
tableName="m_loan_transaction">
             <column name="submitted_on_date"/>
         </createIndex>

Reply via email to