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 81883a18a FINERACT-2081: Add missing index on GL annual summary table
81883a18a is described below

commit 81883a18aafd1980de4b056f74f61c634392ba37
Author: Adam Saghy <[email protected]>
AuthorDate: Thu Jan 9 10:58:35 2025 +0100

    FINERACT-2081: Add missing index on GL annual summary table
---
 ..._create_acc_gl_journal_entry_annual_summary.xml | 59 +++++++++++++++++++---
 1 file changed, 53 insertions(+), 6 deletions(-)

diff --git 
a/fineract-provider/src/main/resources/db/changelog/tenant/parts/0158_create_acc_gl_journal_entry_annual_summary.xml
 
b/fineract-provider/src/main/resources/db/changelog/tenant/parts/0158_create_acc_gl_journal_entry_annual_summary.xml
index 3014d3fa7..8c097ef5e 100644
--- 
a/fineract-provider/src/main/resources/db/changelog/tenant/parts/0158_create_acc_gl_journal_entry_annual_summary.xml
+++ 
b/fineract-provider/src/main/resources/db/changelog/tenant/parts/0158_create_acc_gl_journal_entry_annual_summary.xml
@@ -22,7 +22,7 @@
 <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.1.xsd";>
-    <changeSet id="1" author="fineract" runInTransaction="false" 
context="postgresql">
+    <changeSet id="1" author="fineract" context="postgresql">
         <createTable tableName="acc_gl_journal_entry_annual_summary">
             <column autoIncrement="true" name="id" type="BIGINT">
                 <constraints nullable="false" primaryKey="true" 
primaryKeyName="pk_acc_gl_journal_entry_annual_summary"/>
@@ -56,12 +56,59 @@
         </createTable>
     </changeSet>
 
-    <changeSet author="fineract" id="2" runInTransaction="false" 
context="postgresql">
-        <preConditions onFail="MARK_RAN">
-            <indexExists tableName="acc_gl_journal_entry_annual_summary" 
indexName="acc_gl_journal_entry_annual_summary_idx_1"/>
-        </preConditions>
+    <changeSet id="3" author="fineract" context="mysql">
+        <createTable tableName="acc_gl_journal_entry_annual_summary">
+            <column autoIncrement="true" name="id" type="BIGINT">
+                <constraints nullable="false" primaryKey="true" 
primaryKeyName="pk_acc_gl_journal_entry_annual_summary"/>
+            </column>
+            <column name="gl_code" type="VARCHAR(45)">
+                <constraints nullable="false"/>
+            </column>
+            <column name="product_id" type="BIGINT">
+                <constraints nullable="false"/>
+            </column>
+            <column name="office_id" type="BIGINT">
+                <constraints nullable="false"/>
+            </column>
+            <column name="opening_balance_amount" type="DECIMAL(19, 6)">
+                <constraints nullable="false"/>
+            </column>
+            <column name="currency_code" type="VARCHAR(3)">
+                <constraints nullable="false"/>
+            </column>
+            <column name="owner_external_id" type="VARCHAR(100)"/>
+            <column name="manual_entry" type="boolean" 
defaultValueBoolean="false">
+                <constraints nullable="false"/>
+            </column>
+            <column name="year_end_date" type="DATE">
+                <constraints nullable="false"/>
+            </column>
+            <column name="created_by" type="BIGINT"/>
+            <column name="created_on_utc" type="DATETIME"/>
+            <column name="last_modified_by" type="BIGINT"/>
+            <column name="last_modified_on_utc" type="DATETIME"/>
+        </createTable>
+    </changeSet>
+
+    <changeSet author="fineract" id="4">
+        <addForeignKeyConstraint baseColumnNames="created_by" 
baseTableName="acc_gl_journal_entry_annual_summary"
+                                 constraintName="FK_annual_report_created_by" 
deferrable="false" initiallyDeferred="false"
+                                 onDelete="RESTRICT" onUpdate="RESTRICT" 
referencedColumnNames="id"
+                                 referencedTableName="m_appuser" 
validate="true"/>
+        <addForeignKeyConstraint baseColumnNames="last_modified_by" 
baseTableName="acc_gl_journal_entry_annual_summary"
+                                 
constraintName="FK_annual_report_last_modified_by" deferrable="false" 
initiallyDeferred="false"
+                                 onDelete="RESTRICT" onUpdate="RESTRICT" 
referencedColumnNames="id"
+                                 referencedTableName="m_appuser" 
validate="true"/>
+    </changeSet>
+
+    <changeSet author="fineract" id="5" runInTransaction="false" 
context="postgresql">
+        <sql>
+            create index concurrently if not exists 
acc_gl_journal_entry_annual_summary_idx_1 on 
acc_gl_journal_entry_annual_summary(gl_code,product_id);
+        </sql>
+    </changeSet>
+    <changeSet author="fineract" id="6" context="mysql">
         <sql>
-            create index concurrently 
acc_gl_journal_entry_annual_summary_idx_1 on 
acc_gl_journal_entry_annual_summary(gl_code,product_name);
+            create index acc_gl_journal_entry_annual_summary_idx_1 on 
acc_gl_journal_entry_annual_summary(gl_code,product_id);
         </sql>
     </changeSet>
 </databaseChangeLog>

Reply via email to