Client uniqueness pre-save check + seed all Indian states & UTs
Pre-save validator (ClientWritePlatformServiceJpaRepositoryImpl.validateClientUniqueness) rejects duplicate mobile / email / PAN / Aadhaar (masked) / GSTIN before saveAndFlush and before the LincPay KYC API call. Avoids burning vendor credits on identity-duplicate records and gives the UI a clean field-level 403 instead of waiting for the DB constraint. Splits the new repository finders into "create" and "excluding-self" variants so a nullable Long parameter never reaches PostgreSQL's parser (same bigint <> varchar trap that broke the family-member POST earlier). Also seeds the full set of 28 Indian States + 8 UTs as STATE code_values (migration 0297). Previously only MAHARASHTRA / MADHYA_PRADESH / DELHI existed and the names were UPPER_SNAKE_CASE; the postal PIN-lookup service returns "Madhya Pradesh" so any state other than Maharashtra/Delhi silently failed to resolve to m_address.state_province_id. Renames the 3 existing rows in place (preserves their ids/FKs) and inserts the missing 33 with idempotent preConditions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
026e5fb875
commit
8b4351013e
@@ -308,4 +308,5 @@
|
||||
<include file="parts/0294_add_tfa_token_to_dsc_challenge.xml" relativeToChangelogFile="true"/>
|
||||
<include file="parts/0295_unique_email_mobile_on_m_appuser.xml" relativeToChangelogFile="true"/>
|
||||
<include file="parts/0296_unique_nominee_per_account_type.xml" relativeToChangelogFile="true"/>
|
||||
<include file="parts/0297_seed_indian_states.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
|
||||
+294
@@ -0,0 +1,294 @@
|
||||
<?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
|
||||
-->
|
||||
<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">
|
||||
|
||||
<!--
|
||||
Seed the full set of 28 Indian States + 8 Union Territories under the STATE code so
|
||||
m_address.state_province_id resolution works for every PIN that the
|
||||
api.postalpincode.in lookup returns.
|
||||
|
||||
Before this migration only MAHARASHTRA / MADHYA_PRADESH / DELHI existed and the
|
||||
names were UPPER_SNAKE_CASE — postal API returns Title Case With Spaces
|
||||
("Madhya Pradesh"), so anything except a single-word match silently failed and the
|
||||
client address ended up with state_province_id = NULL.
|
||||
|
||||
Change A renames the 3 existing rows in place (preserves their ids and any FKs
|
||||
already pointing at them — historical client addresses stay linked).
|
||||
Change B inserts the missing 33 (25 states + 8 UTs).
|
||||
|
||||
Names are the canonical postal forms so the UI's case-insensitive name match works
|
||||
directly against api.postalpincode.in output.
|
||||
-->
|
||||
|
||||
<!-- =========================== A: rename existing 3 =========================== -->
|
||||
|
||||
<changeSet id="0297a_rename_maharashtra" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="1">
|
||||
SELECT COUNT(*) FROM m_code_value cv JOIN m_code c ON cv.code_id = c.id
|
||||
WHERE c.code_name = 'STATE' AND cv.code_value = 'MAHARASHTRA'
|
||||
</sqlCheck>
|
||||
</preConditions>
|
||||
<update tableName="m_code_value">
|
||||
<column name="code_value" value="Maharashtra"/>
|
||||
<column name="code_description" value="Indian State"/>
|
||||
<where>code_value = 'MAHARASHTRA'
|
||||
AND code_id = (SELECT id FROM m_code WHERE code_name = 'STATE')</where>
|
||||
</update>
|
||||
</changeSet>
|
||||
|
||||
<changeSet id="0297a_rename_madhya_pradesh" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="1">
|
||||
SELECT COUNT(*) FROM m_code_value cv JOIN m_code c ON cv.code_id = c.id
|
||||
WHERE c.code_name = 'STATE' AND cv.code_value = 'MADHYA_PRADESH'
|
||||
</sqlCheck>
|
||||
</preConditions>
|
||||
<update tableName="m_code_value">
|
||||
<column name="code_value" value="Madhya Pradesh"/>
|
||||
<column name="code_description" value="Indian State"/>
|
||||
<where>code_value = 'MADHYA_PRADESH'
|
||||
AND code_id = (SELECT id FROM m_code WHERE code_name = 'STATE')</where>
|
||||
</update>
|
||||
</changeSet>
|
||||
|
||||
<changeSet id="0297a_rename_delhi" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="1">
|
||||
SELECT COUNT(*) FROM m_code_value cv JOIN m_code c ON cv.code_id = c.id
|
||||
WHERE c.code_name = 'STATE' AND cv.code_value = 'DELHI'
|
||||
</sqlCheck>
|
||||
</preConditions>
|
||||
<update tableName="m_code_value">
|
||||
<column name="code_value" value="Delhi"/>
|
||||
<column name="code_description" value="Union Territory"/>
|
||||
<where>code_value = 'DELHI'
|
||||
AND code_id = (SELECT id FROM m_code WHERE code_name = 'STATE')</where>
|
||||
</update>
|
||||
</changeSet>
|
||||
|
||||
<!-- =========================== B: insert the missing 33 ====================== -->
|
||||
<!--
|
||||
Each row is guarded by a sqlCheck so the migration is idempotent: re-running it
|
||||
won't create duplicates and won't fail when one is already present.
|
||||
Names follow api.postalpincode.in's exact spellings.
|
||||
-->
|
||||
|
||||
<!-- ── States (25) ─────────────────────────────────────────────────────────── -->
|
||||
|
||||
<changeSet id="0297b_state_andhra_pradesh" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="0">SELECT COUNT(*) FROM m_code_value cv JOIN m_code c ON cv.code_id = c.id WHERE c.code_name = 'STATE' AND cv.code_value = 'Andhra Pradesh'</sqlCheck>
|
||||
</preConditions>
|
||||
<sql>INSERT INTO m_code_value (code_id, code_value, code_description, order_position, is_active, is_mandatory) SELECT id, 'Andhra Pradesh', 'Indian State', 1, true, false FROM m_code WHERE code_name = 'STATE'</sql>
|
||||
</changeSet>
|
||||
<changeSet id="0297b_state_arunachal_pradesh" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="0">SELECT COUNT(*) FROM m_code_value cv JOIN m_code c ON cv.code_id = c.id WHERE c.code_name = 'STATE' AND cv.code_value = 'Arunachal Pradesh'</sqlCheck>
|
||||
</preConditions>
|
||||
<sql>INSERT INTO m_code_value (code_id, code_value, code_description, order_position, is_active, is_mandatory) SELECT id, 'Arunachal Pradesh', 'Indian State', 2, true, false FROM m_code WHERE code_name = 'STATE'</sql>
|
||||
</changeSet>
|
||||
<changeSet id="0297b_state_assam" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="0">SELECT COUNT(*) FROM m_code_value cv JOIN m_code c ON cv.code_id = c.id WHERE c.code_name = 'STATE' AND cv.code_value = 'Assam'</sqlCheck>
|
||||
</preConditions>
|
||||
<sql>INSERT INTO m_code_value (code_id, code_value, code_description, order_position, is_active, is_mandatory) SELECT id, 'Assam', 'Indian State', 3, true, false FROM m_code WHERE code_name = 'STATE'</sql>
|
||||
</changeSet>
|
||||
<changeSet id="0297b_state_bihar" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="0">SELECT COUNT(*) FROM m_code_value cv JOIN m_code c ON cv.code_id = c.id WHERE c.code_name = 'STATE' AND cv.code_value = 'Bihar'</sqlCheck>
|
||||
</preConditions>
|
||||
<sql>INSERT INTO m_code_value (code_id, code_value, code_description, order_position, is_active, is_mandatory) SELECT id, 'Bihar', 'Indian State', 4, true, false FROM m_code WHERE code_name = 'STATE'</sql>
|
||||
</changeSet>
|
||||
<changeSet id="0297b_state_chhattisgarh" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="0">SELECT COUNT(*) FROM m_code_value cv JOIN m_code c ON cv.code_id = c.id WHERE c.code_name = 'STATE' AND cv.code_value = 'Chhattisgarh'</sqlCheck>
|
||||
</preConditions>
|
||||
<sql>INSERT INTO m_code_value (code_id, code_value, code_description, order_position, is_active, is_mandatory) SELECT id, 'Chhattisgarh', 'Indian State', 5, true, false FROM m_code WHERE code_name = 'STATE'</sql>
|
||||
</changeSet>
|
||||
<changeSet id="0297b_state_goa" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="0">SELECT COUNT(*) FROM m_code_value cv JOIN m_code c ON cv.code_id = c.id WHERE c.code_name = 'STATE' AND cv.code_value = 'Goa'</sqlCheck>
|
||||
</preConditions>
|
||||
<sql>INSERT INTO m_code_value (code_id, code_value, code_description, order_position, is_active, is_mandatory) SELECT id, 'Goa', 'Indian State', 6, true, false FROM m_code WHERE code_name = 'STATE'</sql>
|
||||
</changeSet>
|
||||
<changeSet id="0297b_state_gujarat" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="0">SELECT COUNT(*) FROM m_code_value cv JOIN m_code c ON cv.code_id = c.id WHERE c.code_name = 'STATE' AND cv.code_value = 'Gujarat'</sqlCheck>
|
||||
</preConditions>
|
||||
<sql>INSERT INTO m_code_value (code_id, code_value, code_description, order_position, is_active, is_mandatory) SELECT id, 'Gujarat', 'Indian State', 7, true, false FROM m_code WHERE code_name = 'STATE'</sql>
|
||||
</changeSet>
|
||||
<changeSet id="0297b_state_haryana" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="0">SELECT COUNT(*) FROM m_code_value cv JOIN m_code c ON cv.code_id = c.id WHERE c.code_name = 'STATE' AND cv.code_value = 'Haryana'</sqlCheck>
|
||||
</preConditions>
|
||||
<sql>INSERT INTO m_code_value (code_id, code_value, code_description, order_position, is_active, is_mandatory) SELECT id, 'Haryana', 'Indian State', 8, true, false FROM m_code WHERE code_name = 'STATE'</sql>
|
||||
</changeSet>
|
||||
<changeSet id="0297b_state_himachal_pradesh" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="0">SELECT COUNT(*) FROM m_code_value cv JOIN m_code c ON cv.code_id = c.id WHERE c.code_name = 'STATE' AND cv.code_value = 'Himachal Pradesh'</sqlCheck>
|
||||
</preConditions>
|
||||
<sql>INSERT INTO m_code_value (code_id, code_value, code_description, order_position, is_active, is_mandatory) SELECT id, 'Himachal Pradesh', 'Indian State', 9, true, false FROM m_code WHERE code_name = 'STATE'</sql>
|
||||
</changeSet>
|
||||
<changeSet id="0297b_state_jharkhand" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="0">SELECT COUNT(*) FROM m_code_value cv JOIN m_code c ON cv.code_id = c.id WHERE c.code_name = 'STATE' AND cv.code_value = 'Jharkhand'</sqlCheck>
|
||||
</preConditions>
|
||||
<sql>INSERT INTO m_code_value (code_id, code_value, code_description, order_position, is_active, is_mandatory) SELECT id, 'Jharkhand', 'Indian State', 10, true, false FROM m_code WHERE code_name = 'STATE'</sql>
|
||||
</changeSet>
|
||||
<changeSet id="0297b_state_karnataka" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="0">SELECT COUNT(*) FROM m_code_value cv JOIN m_code c ON cv.code_id = c.id WHERE c.code_name = 'STATE' AND cv.code_value = 'Karnataka'</sqlCheck>
|
||||
</preConditions>
|
||||
<sql>INSERT INTO m_code_value (code_id, code_value, code_description, order_position, is_active, is_mandatory) SELECT id, 'Karnataka', 'Indian State', 11, true, false FROM m_code WHERE code_name = 'STATE'</sql>
|
||||
</changeSet>
|
||||
<changeSet id="0297b_state_kerala" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="0">SELECT COUNT(*) FROM m_code_value cv JOIN m_code c ON cv.code_id = c.id WHERE c.code_name = 'STATE' AND cv.code_value = 'Kerala'</sqlCheck>
|
||||
</preConditions>
|
||||
<sql>INSERT INTO m_code_value (code_id, code_value, code_description, order_position, is_active, is_mandatory) SELECT id, 'Kerala', 'Indian State', 12, true, false FROM m_code WHERE code_name = 'STATE'</sql>
|
||||
</changeSet>
|
||||
<changeSet id="0297b_state_manipur" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="0">SELECT COUNT(*) FROM m_code_value cv JOIN m_code c ON cv.code_id = c.id WHERE c.code_name = 'STATE' AND cv.code_value = 'Manipur'</sqlCheck>
|
||||
</preConditions>
|
||||
<sql>INSERT INTO m_code_value (code_id, code_value, code_description, order_position, is_active, is_mandatory) SELECT id, 'Manipur', 'Indian State', 15, true, false FROM m_code WHERE code_name = 'STATE'</sql>
|
||||
</changeSet>
|
||||
<changeSet id="0297b_state_meghalaya" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="0">SELECT COUNT(*) FROM m_code_value cv JOIN m_code c ON cv.code_id = c.id WHERE c.code_name = 'STATE' AND cv.code_value = 'Meghalaya'</sqlCheck>
|
||||
</preConditions>
|
||||
<sql>INSERT INTO m_code_value (code_id, code_value, code_description, order_position, is_active, is_mandatory) SELECT id, 'Meghalaya', 'Indian State', 16, true, false FROM m_code WHERE code_name = 'STATE'</sql>
|
||||
</changeSet>
|
||||
<changeSet id="0297b_state_mizoram" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="0">SELECT COUNT(*) FROM m_code_value cv JOIN m_code c ON cv.code_id = c.id WHERE c.code_name = 'STATE' AND cv.code_value = 'Mizoram'</sqlCheck>
|
||||
</preConditions>
|
||||
<sql>INSERT INTO m_code_value (code_id, code_value, code_description, order_position, is_active, is_mandatory) SELECT id, 'Mizoram', 'Indian State', 17, true, false FROM m_code WHERE code_name = 'STATE'</sql>
|
||||
</changeSet>
|
||||
<changeSet id="0297b_state_nagaland" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="0">SELECT COUNT(*) FROM m_code_value cv JOIN m_code c ON cv.code_id = c.id WHERE c.code_name = 'STATE' AND cv.code_value = 'Nagaland'</sqlCheck>
|
||||
</preConditions>
|
||||
<sql>INSERT INTO m_code_value (code_id, code_value, code_description, order_position, is_active, is_mandatory) SELECT id, 'Nagaland', 'Indian State', 18, true, false FROM m_code WHERE code_name = 'STATE'</sql>
|
||||
</changeSet>
|
||||
<changeSet id="0297b_state_odisha" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="0">SELECT COUNT(*) FROM m_code_value cv JOIN m_code c ON cv.code_id = c.id WHERE c.code_name = 'STATE' AND cv.code_value = 'Odisha'</sqlCheck>
|
||||
</preConditions>
|
||||
<sql>INSERT INTO m_code_value (code_id, code_value, code_description, order_position, is_active, is_mandatory) SELECT id, 'Odisha', 'Indian State', 19, true, false FROM m_code WHERE code_name = 'STATE'</sql>
|
||||
</changeSet>
|
||||
<changeSet id="0297b_state_punjab" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="0">SELECT COUNT(*) FROM m_code_value cv JOIN m_code c ON cv.code_id = c.id WHERE c.code_name = 'STATE' AND cv.code_value = 'Punjab'</sqlCheck>
|
||||
</preConditions>
|
||||
<sql>INSERT INTO m_code_value (code_id, code_value, code_description, order_position, is_active, is_mandatory) SELECT id, 'Punjab', 'Indian State', 20, true, false FROM m_code WHERE code_name = 'STATE'</sql>
|
||||
</changeSet>
|
||||
<changeSet id="0297b_state_rajasthan" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="0">SELECT COUNT(*) FROM m_code_value cv JOIN m_code c ON cv.code_id = c.id WHERE c.code_name = 'STATE' AND cv.code_value = 'Rajasthan'</sqlCheck>
|
||||
</preConditions>
|
||||
<sql>INSERT INTO m_code_value (code_id, code_value, code_description, order_position, is_active, is_mandatory) SELECT id, 'Rajasthan', 'Indian State', 21, true, false FROM m_code WHERE code_name = 'STATE'</sql>
|
||||
</changeSet>
|
||||
<changeSet id="0297b_state_sikkim" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="0">SELECT COUNT(*) FROM m_code_value cv JOIN m_code c ON cv.code_id = c.id WHERE c.code_name = 'STATE' AND cv.code_value = 'Sikkim'</sqlCheck>
|
||||
</preConditions>
|
||||
<sql>INSERT INTO m_code_value (code_id, code_value, code_description, order_position, is_active, is_mandatory) SELECT id, 'Sikkim', 'Indian State', 22, true, false FROM m_code WHERE code_name = 'STATE'</sql>
|
||||
</changeSet>
|
||||
<changeSet id="0297b_state_tamil_nadu" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="0">SELECT COUNT(*) FROM m_code_value cv JOIN m_code c ON cv.code_id = c.id WHERE c.code_name = 'STATE' AND cv.code_value = 'Tamil Nadu'</sqlCheck>
|
||||
</preConditions>
|
||||
<sql>INSERT INTO m_code_value (code_id, code_value, code_description, order_position, is_active, is_mandatory) SELECT id, 'Tamil Nadu', 'Indian State', 23, true, false FROM m_code WHERE code_name = 'STATE'</sql>
|
||||
</changeSet>
|
||||
<changeSet id="0297b_state_telangana" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="0">SELECT COUNT(*) FROM m_code_value cv JOIN m_code c ON cv.code_id = c.id WHERE c.code_name = 'STATE' AND cv.code_value = 'Telangana'</sqlCheck>
|
||||
</preConditions>
|
||||
<sql>INSERT INTO m_code_value (code_id, code_value, code_description, order_position, is_active, is_mandatory) SELECT id, 'Telangana', 'Indian State', 24, true, false FROM m_code WHERE code_name = 'STATE'</sql>
|
||||
</changeSet>
|
||||
<changeSet id="0297b_state_tripura" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="0">SELECT COUNT(*) FROM m_code_value cv JOIN m_code c ON cv.code_id = c.id WHERE c.code_name = 'STATE' AND cv.code_value = 'Tripura'</sqlCheck>
|
||||
</preConditions>
|
||||
<sql>INSERT INTO m_code_value (code_id, code_value, code_description, order_position, is_active, is_mandatory) SELECT id, 'Tripura', 'Indian State', 25, true, false FROM m_code WHERE code_name = 'STATE'</sql>
|
||||
</changeSet>
|
||||
<changeSet id="0297b_state_uttar_pradesh" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="0">SELECT COUNT(*) FROM m_code_value cv JOIN m_code c ON cv.code_id = c.id WHERE c.code_name = 'STATE' AND cv.code_value = 'Uttar Pradesh'</sqlCheck>
|
||||
</preConditions>
|
||||
<sql>INSERT INTO m_code_value (code_id, code_value, code_description, order_position, is_active, is_mandatory) SELECT id, 'Uttar Pradesh', 'Indian State', 26, true, false FROM m_code WHERE code_name = 'STATE'</sql>
|
||||
</changeSet>
|
||||
<changeSet id="0297b_state_uttarakhand" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="0">SELECT COUNT(*) FROM m_code_value cv JOIN m_code c ON cv.code_id = c.id WHERE c.code_name = 'STATE' AND cv.code_value = 'Uttarakhand'</sqlCheck>
|
||||
</preConditions>
|
||||
<sql>INSERT INTO m_code_value (code_id, code_value, code_description, order_position, is_active, is_mandatory) SELECT id, 'Uttarakhand', 'Indian State', 27, true, false FROM m_code WHERE code_name = 'STATE'</sql>
|
||||
</changeSet>
|
||||
<changeSet id="0297b_state_west_bengal" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="0">SELECT COUNT(*) FROM m_code_value cv JOIN m_code c ON cv.code_id = c.id WHERE c.code_name = 'STATE' AND cv.code_value = 'West Bengal'</sqlCheck>
|
||||
</preConditions>
|
||||
<sql>INSERT INTO m_code_value (code_id, code_value, code_description, order_position, is_active, is_mandatory) SELECT id, 'West Bengal', 'Indian State', 28, true, false FROM m_code WHERE code_name = 'STATE'</sql>
|
||||
</changeSet>
|
||||
|
||||
<!-- ── Union Territories (7 new — Delhi already renamed above) ─────────────── -->
|
||||
|
||||
<changeSet id="0297b_ut_andaman_nicobar" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="0">SELECT COUNT(*) FROM m_code_value cv JOIN m_code c ON cv.code_id = c.id WHERE c.code_name = 'STATE' AND cv.code_value = 'Andaman and Nicobar Islands'</sqlCheck>
|
||||
</preConditions>
|
||||
<sql>INSERT INTO m_code_value (code_id, code_value, code_description, order_position, is_active, is_mandatory) SELECT id, 'Andaman and Nicobar Islands', 'Union Territory', 29, true, false FROM m_code WHERE code_name = 'STATE'</sql>
|
||||
</changeSet>
|
||||
<changeSet id="0297b_ut_chandigarh" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="0">SELECT COUNT(*) FROM m_code_value cv JOIN m_code c ON cv.code_id = c.id WHERE c.code_name = 'STATE' AND cv.code_value = 'Chandigarh'</sqlCheck>
|
||||
</preConditions>
|
||||
<sql>INSERT INTO m_code_value (code_id, code_value, code_description, order_position, is_active, is_mandatory) SELECT id, 'Chandigarh', 'Union Territory', 30, true, false FROM m_code WHERE code_name = 'STATE'</sql>
|
||||
</changeSet>
|
||||
<changeSet id="0297b_ut_dnh_dd" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="0">SELECT COUNT(*) FROM m_code_value cv JOIN m_code c ON cv.code_id = c.id WHERE c.code_name = 'STATE' AND cv.code_value = 'Dadra and Nagar Haveli and Daman and Diu'</sqlCheck>
|
||||
</preConditions>
|
||||
<sql>INSERT INTO m_code_value (code_id, code_value, code_description, order_position, is_active, is_mandatory) SELECT id, 'Dadra and Nagar Haveli and Daman and Diu', 'Union Territory', 31, true, false FROM m_code WHERE code_name = 'STATE'</sql>
|
||||
</changeSet>
|
||||
<changeSet id="0297b_ut_jammu_kashmir" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="0">SELECT COUNT(*) FROM m_code_value cv JOIN m_code c ON cv.code_id = c.id WHERE c.code_name = 'STATE' AND cv.code_value = 'Jammu and Kashmir'</sqlCheck>
|
||||
</preConditions>
|
||||
<sql>INSERT INTO m_code_value (code_id, code_value, code_description, order_position, is_active, is_mandatory) SELECT id, 'Jammu and Kashmir', 'Union Territory', 33, true, false FROM m_code WHERE code_name = 'STATE'</sql>
|
||||
</changeSet>
|
||||
<changeSet id="0297b_ut_ladakh" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="0">SELECT COUNT(*) FROM m_code_value cv JOIN m_code c ON cv.code_id = c.id WHERE c.code_name = 'STATE' AND cv.code_value = 'Ladakh'</sqlCheck>
|
||||
</preConditions>
|
||||
<sql>INSERT INTO m_code_value (code_id, code_value, code_description, order_position, is_active, is_mandatory) SELECT id, 'Ladakh', 'Union Territory', 34, true, false FROM m_code WHERE code_name = 'STATE'</sql>
|
||||
</changeSet>
|
||||
<changeSet id="0297b_ut_lakshadweep" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="0">SELECT COUNT(*) FROM m_code_value cv JOIN m_code c ON cv.code_id = c.id WHERE c.code_name = 'STATE' AND cv.code_value = 'Lakshadweep'</sqlCheck>
|
||||
</preConditions>
|
||||
<sql>INSERT INTO m_code_value (code_id, code_value, code_description, order_position, is_active, is_mandatory) SELECT id, 'Lakshadweep', 'Union Territory', 35, true, false FROM m_code WHERE code_name = 'STATE'</sql>
|
||||
</changeSet>
|
||||
<changeSet id="0297b_ut_puducherry" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="0">SELECT COUNT(*) FROM m_code_value cv JOIN m_code c ON cv.code_id = c.id WHERE c.code_name = 'STATE' AND cv.code_value = 'Puducherry'</sqlCheck>
|
||||
</preConditions>
|
||||
<sql>INSERT INTO m_code_value (code_id, code_value, code_description, order_position, is_active, is_mandatory) SELECT id, 'Puducherry', 'Union Territory', 36, true, false FROM m_code WHERE code_name = 'STATE'</sql>
|
||||
</changeSet>
|
||||
|
||||
</databaseChangeLog>
|
||||
Reference in New Issue
Block a user