budaidev commented on code in PR #6147:
URL: https://github.com/apache/fineract/pull/6147#discussion_r3622227126


##########
fineract-working-capital-loan/src/main/resources/db/changelog/tenant/module/workingcapitalloan/parts/0052_wc_breach_start_type.xml:
##########
@@ -0,0 +1,54 @@
+<?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="wclp-0052-1-add-breach-start-type-to-wc-loan-product">
+        <preConditions onFail="MARK_RAN">
+            <and>
+                <tableExists tableName="m_wc_loan_product"/>
+                <not>
+                    <columnExists tableName="m_wc_loan_product" 
columnName="breach_start_type"/>
+                </not>
+            </and>
+        </preConditions>
+        <addColumn tableName="m_wc_loan_product">
+            <column name="breach_start_type" type="VARCHAR(20)" />
+        </addColumn>
+    </changeSet>
+
+    <changeSet author="fineract" 
id="wclp-0052-2-add-breach-start-type-to-wc-loan">
+        <preConditions onFail="MARK_RAN">
+            <and>
+                <tableExists tableName="m_wc_loan"/>
+                <not>
+                    <columnExists tableName="m_wc_loan" 
columnName="breach_start_type"/>

Review Comment:
   > Should we set a default value if `null` is provided? That way we can mark 
it as `not nullable` similarly as `delinquency_start_type` works.
   
   You are right. Done, breach_start_type is now NOT NULL with a DISBURSEMENT 
default. The migration sets defaultValue="DISBURSEMENT" + nullable="false" on 
both m_wc_loan_product and m_wc_loan — the ADD COLUMN … DEFAULT 'DISBURSEMENT' 
backfills any existing rows, so the constraint holds.
   



-- 
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]

Reply via email to