budaidev commented on code in PR #5771: URL: https://github.com/apache/fineract/pull/5771#discussion_r3225001431
########## fineract-working-capital-loan/src/main/resources/db/changelog/tenant/module/workingcapitalloan/parts/0036_wc_loan_period_payment_rate_change.xml: ########## @@ -0,0 +1,135 @@ +<?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.3.xsd"> + + <changeSet author="fineract" id="wcl-0036-1-create-rate-change-table"> + <preConditions onFail="MARK_RAN"> + <not> + <tableExists tableName="m_wc_loan_period_payment_rate_change"/> + </not> + </preConditions> + <createTable tableName="m_wc_loan_period_payment_rate_change"> + <column autoIncrement="true" name="id" type="BIGINT"> + <constraints nullable="false" primaryKey="true"/> + </column> + <column name="wc_loan_id" type="BIGINT"> + <constraints nullable="false"/> + </column> + <column name="effective_date" type="DATE"> + <constraints nullable="false"/> + </column> + <column name="previous_rate" type="DECIMAL(19,6)"> + <constraints nullable="false"/> + </column> + <column name="new_rate" type="DECIMAL(19,6)"> + <constraints nullable="false"/> + </column> + <column name="is_reversed" type="BOOLEAN" defaultValueBoolean="false"> + <constraints nullable="false"/> + </column> + <column name="reversed_on_date" type="DATE"/> + <column name="created_by" type="BIGINT"> + <constraints nullable="false"/> + </column> + <column name="last_modified_by" type="BIGINT"> + <constraints nullable="false"/> + </column> + <column name="version" type="INT" defaultValueNumeric="0"> + <constraints nullable="false"/> + </column> + </createTable> + </changeSet> + + <changeSet author="fineract" id="wcl-0036-2-audit-columns-my" context="mysql"> + <addColumn tableName="m_wc_loan_period_payment_rate_change"> + <column name="created_on_utc" type="DATETIME(6)"> + <constraints nullable="false"/> + </column> + <column name="last_modified_on_utc" type="DATETIME(6)"> + <constraints nullable="false"/> + </column> + </addColumn> + </changeSet> + + <changeSet author="fineract" id="wcl-0036-2-audit-columns-pg" context="postgresql"> + <addColumn tableName="m_wc_loan_period_payment_rate_change"> + <column name="created_on_utc" type="TIMESTAMP WITH TIME ZONE"> + <constraints nullable="false"/> + </column> + <column name="last_modified_on_utc" type="TIMESTAMP WITH TIME ZONE"> + <constraints nullable="false"/> + </column> + </addColumn> + </changeSet> + + <changeSet author="fineract" id="wcl-0036-3-rate-change-fks"> + <addForeignKeyConstraint baseColumnNames="wc_loan_id" baseTableName="m_wc_loan_period_payment_rate_change" + constraintName="fk_wc_rate_change_loan" referencedColumnNames="id" + referencedTableName="m_wc_loan"/> + <addForeignKeyConstraint baseColumnNames="created_by" baseTableName="m_wc_loan_period_payment_rate_change" + constraintName="fk_wc_rate_change_created_by" referencedColumnNames="id" + referencedTableName="m_appuser"/> + <addForeignKeyConstraint baseColumnNames="last_modified_by" baseTableName="m_wc_loan_period_payment_rate_change" + constraintName="fk_wc_rate_change_last_modified_by" referencedColumnNames="id" + referencedTableName="m_appuser"/> + </changeSet> + + <changeSet author="fineract" id="wcl-0036-4-rate-change-index"> + <createIndex tableName="m_wc_loan_period_payment_rate_change" indexName="idx_wc_rate_change_loan_date"> + <column name="wc_loan_id"/> + <column name="effective_date"/> + </createIndex> + </changeSet> + + <changeSet author="fineract" id="wcl-0036-6-update-rate-permission"> + <preConditions onFail="MARK_RAN"> + <sqlCheck expectedResult="0"> + SELECT COUNT(*) FROM m_permission WHERE code = 'UPDATERATE_WORKINGCAPITALLOAN'; + </sqlCheck> + </preConditions> + <insert tableName="m_permission"> + <column name="grouping" value="portfolio"/> + <column name="code" value="UPDATERATE_WORKINGCAPITALLOAN"/> + <column name="entity_name" value="WORKINGCAPITALLOAN"/> + <column name="action_name" value="UPDATERATE"/> + <column name="can_maker_checker" valueBoolean="false"/> + </insert> + </changeSet> + + <changeSet author="fineract" id="wcl-0036-7-undo-rate-change-permission"> Review Comment: it's a future plan, but no implementation behind it. Dropped -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
