Skip to content

Commit

Permalink
Merge pull request #1367 from fiterlatam/bug/SUP-462
Browse files Browse the repository at this point in the history
SUP-462: Restrict deletion of code values in use
  • Loading branch information
hagafrank authored Dec 10, 2024
2 parents eee5b0d + 7970c1c commit 77f06f7
Show file tree
Hide file tree
Showing 2 changed files with 170 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -330,4 +330,5 @@
<include file="parts/20240507011009134_SU_477_update_reports_migration_aval_charge.xml" relativeToChangelogFile="true"/>
<include file="parts/20243008011009142_SU_488_update_report._archivo.xml" relativeToChangelogFile="true"/>
<include file="parts/20241208121243_SU_485_client_death_blocking_reason.xml" relativeToChangelogFile="true"/>
<include file="parts/202412101146000000_SU_462_c_client_ally_point_of_sales_UPDATE_CONSTRAINT.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
<?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="91">
<!-- Drop the existing foreign key constraint -->
<dropForeignKeyConstraint
baseTableSchemaName="custom"
baseTableName="c_client_ally_point_of_sales"
constraintName="fk_city_code_value"/>
</changeSet>

<changeSet author="fineract" id="92">
<addForeignKeyConstraint baseTableSchemaName="custom"
baseTableName="c_client_ally_point_of_sales"
baseColumnNames="city_id"
referencedTableSchemaName="public"
referencedTableName="m_code_value"
referencedColumnNames="id"
constraintName="fk_city_code_value"
onDelete="RESTRICT"
onUpdate="RESTRICT"
validate="true"/>
</changeSet>

<changeSet author="fineract" id="93">
<!-- Drop the existing foreign key constraint -->
<dropForeignKeyConstraint
baseTableSchemaName="custom"
baseTableName="c_client_ally_point_of_sales"
constraintName="fk_department_code_value"/>
</changeSet>
<changeSet author="fineract" id="94">
<addForeignKeyConstraint baseTableSchemaName="custom"
baseTableName="c_client_ally_point_of_sales"
baseColumnNames="department_id"
referencedTableSchemaName="public"
referencedTableName="m_code_value"
referencedColumnNames="id"
constraintName="fk_department_code_value"
onDelete="RESTRICT"
onUpdate="RESTRICT"
validate="true"/>
</changeSet>

<changeSet author="fineract" id="95">
<!-- Drop the existing foreign key constraint -->
<dropForeignKeyConstraint
baseTableSchemaName="custom"
baseTableName="c_client_ally_point_of_sales"
constraintName="fk_brand_id_code_value"/>
</changeSet>

<changeSet author="fineract" id="96">
<addForeignKeyConstraint baseTableSchemaName="custom"
baseTableName="c_client_ally_point_of_sales"
baseColumnNames="brand_id"
referencedTableSchemaName="public"
referencedTableName="m_code_value"
referencedColumnNames="id"
constraintName="fk_brand_id_code_value"
onDelete="RESTRICT"
onUpdate="RESTRICT"
validate="true"/>
</changeSet>

<changeSet author="fineract" id="97">
<!-- Drop the existing foreign key constraint -->
<dropForeignKeyConstraint
baseTableSchemaName="custom"
baseTableName="c_client_ally_point_of_sales"
constraintName="fk_category_id_code_value"/>
</changeSet>
<changeSet author="fineract" id="98">
<addForeignKeyConstraint baseTableSchemaName="custom"
baseTableName="c_client_ally_point_of_sales"
baseColumnNames="category_id"
referencedTableSchemaName="public"
referencedTableName="m_code_value"
referencedColumnNames="id"
constraintName="fk_category_id_code_value"
onDelete="RESTRICT"
onUpdate="RESTRICT"
validate="true"/>
</changeSet>

<changeSet author="fineract" id="99">
<!-- Drop the existing foreign key constraint -->
<dropForeignKeyConstraint
baseTableSchemaName="custom"
baseTableName="c_client_ally_point_of_sales"
constraintName="fk_segment_id_code_value"/>
</changeSet>
<changeSet author="fineract" id="100">
<addForeignKeyConstraint baseTableSchemaName="custom"
baseTableName="c_client_ally_point_of_sales"
baseColumnNames="segment_id"
referencedTableSchemaName="public"
referencedTableName="m_code_value"
referencedColumnNames="id"
constraintName="fk_segment_id_code_value"
onDelete="RESTRICT"
onUpdate="RESTRICT"
validate="true"/>
</changeSet>

<changeSet author="fineract" id="101">
<!-- Drop the existing foreign key constraint -->
<dropForeignKeyConstraint
baseTableSchemaName="custom"
baseTableName="c_client_ally_point_of_sales"
constraintName="fk_type_id_code_value"/>
</changeSet>
<changeSet author="fineract" id="102">
<addForeignKeyConstraint baseTableSchemaName="custom"
baseTableName="c_client_ally_point_of_sales"
baseColumnNames="type_id"
referencedTableSchemaName="public"
referencedTableName="m_code_value"
referencedColumnNames="id"
constraintName="fk_type_id_code_value"
onDelete="RESTRICT"
onUpdate="RESTRICT"
validate="true"/>
</changeSet>

<changeSet author="fineract" id="103">
<!-- Drop the existing foreign key constraint -->
<dropForeignKeyConstraint
baseTableSchemaName="custom"
baseTableName="c_client_ally_point_of_sales"
constraintName="fk_state_id_code_value"/>
</changeSet>
<changeSet author="fineract" id="104">
<addForeignKeyConstraint baseTableSchemaName="custom"
baseTableName="c_client_ally_point_of_sales"
baseColumnNames="state_id"
referencedTableSchemaName="public"
referencedTableName="m_code_value"
referencedColumnNames="id"
constraintName="fk_state_id_code_value"
onDelete="RESTRICT"
onUpdate="RESTRICT"
validate="true"/>
</changeSet>


</databaseChangeLog>

0 comments on commit 77f06f7

Please sign in to comment.