FINERACT-2181: Add missing index for transaction_id field of acc_gl_journal_entry table

This commit is contained in:
Adam Saghy
2025-05-25 19:18:21 +02:00
parent b0a9bcb3ec
commit 25ef93a30b
2 changed files with 49 additions and 0 deletions
@@ -195,4 +195,5 @@
<include file="parts/0174_loan_product_add_capitalized_income_type.xml" relativeToChangelogFile="true" />
<include file="parts/0175_add_fk_acc_product_mapping.xml" relativeToChangelogFile="true" />
<include file="parts/0176_add_capitalized_income_amortization_transaction.xml" relativeToChangelogFile="true" />
<include file="parts/0177_acc_journal_entry_index.xml" relativeToChangelogFile="true" />
</databaseChangeLog>
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<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 author="fineract" id="1" runInTransaction="false" context="postgresql">
<preConditions onFail="MARK_RAN">
<sqlCheck expectedResult="0">
SELECT COUNT(*) FROM pg_indexes WHERE tablename='acc_gl_journal_entry' and indexname='idx_acc_gl_journal_entry_transaction_id';
</sqlCheck>
</preConditions>
<sql>
CREATE INDEX CONCURRENTLY idx_acc_gl_journal_entry_transaction_id ON acc_gl_journal_entry(transaction_id);
</sql>
</changeSet>
<changeSet author="fineract" id="2-mysql" runInTransaction="false" context="mysql">
<preConditions onFail="MARK_RAN">
<sqlCheck expectedResult="0">
SELECT COUNT(*) FROM information_schema.statistics
WHERE table_schema = DATABASE()
AND table_name = 'acc_gl_journal_entry'
AND index_name = 'idx_acc_gl_journal_entry_transaction_id';
</sqlCheck>
</preConditions>
<sql>
CREATE INDEX idx_acc_gl_journal_entry_transaction_id ON acc_gl_journal_entry(transaction_id);
</sql>
</changeSet>
</databaseChangeLog>