FINERACT-1744 add idempotency key to command_source table
This commit is contained in:
committed by
Arnold Gálovics
parent
dae12cdd46
commit
f3aeef2f45
@@ -25,6 +25,8 @@
|
||||
<property name="current_date" value="CURDATE()" context="mysql"/>
|
||||
<property name="current_date" value="CURRENT_DATE" context="postgresql"/>
|
||||
<property name="current_datetime" value="NOW()"/>
|
||||
<property name="uuid" value="uuid()" context="mysql"/>
|
||||
<property name="uuid" value="uuid_generate_v4()" context="postgresql"/>
|
||||
<include file="tenant-store/initial-switch-changelog-tenant-store.xml" relativeToChangelogFile="true" context="tenant_store_db AND initial_switch"/>
|
||||
<include file="tenant-store/changelog-tenant-store.xml" relativeToChangelogFile="true" context="tenant_store_db AND !initial_switch"/>
|
||||
<include file="tenant/initial-switch-changelog-tenant.xml" relativeToChangelogFile="true" context="tenant_db AND initial_switch"/>
|
||||
|
||||
@@ -80,4 +80,5 @@
|
||||
<include file="parts/0058_add_execute_inline_cob_permission.xml" relativeToChangelogFile="true"/>
|
||||
<include file="parts/0059_add_spring_batch_loan_id_list_table.xml" relativeToChangelogFile="true"/>
|
||||
<include file="parts/0060_add_job_name_to_command_source.xml" relativeToChangelogFile="true"/>
|
||||
<include file="parts/0061_add_idempotency_key_to_command_source.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
<?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" context="postgresql">
|
||||
<sql>
|
||||
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
|
||||
</sql>
|
||||
</changeSet>
|
||||
|
||||
<changeSet author="fineract" id="2">
|
||||
<addColumn tableName="m_portfolio_command_source">
|
||||
<column defaultValueComputed="NULL" name="idempotency_key" type="VARCHAR(50)"/>
|
||||
</addColumn>
|
||||
<update tableName="m_portfolio_command_source">
|
||||
<column name="idempotency_key" valueComputed="${uuid}" />
|
||||
<where>idempotency_key is null</where>
|
||||
</update>
|
||||
<addUniqueConstraint columnNames="action_name, entity_name, idempotency_key" constraintName="UNIQUE_PORTFOLIO_COMMAND_SOURCE"
|
||||
tableName="m_portfolio_command_source"/>
|
||||
<createIndex indexName="portfolio_command_source_composite_index" tableName="m_portfolio_command_source">
|
||||
<column name="action_name"/>
|
||||
<column name="entity_name"/>
|
||||
<column name="idempotency_key"/>
|
||||
</createIndex>
|
||||
</changeSet>
|
||||
|
||||
<changeSet author="fineract" id="3" context="postgresql">
|
||||
<addNotNullConstraint columnName="idempotency_key"
|
||||
constraintName="mpcs_idempotency_key_nn"
|
||||
tableName="m_portfolio_command_source"/>
|
||||
</changeSet>
|
||||
|
||||
<changeSet author="fineract" id="4" context="mysql">
|
||||
<sql>
|
||||
ALTER TABLE m_portfolio_command_source MODIFY idempotency_key VARCHAR(50) not NULL
|
||||
</sql>
|
||||
</changeSet>
|
||||
</databaseChangeLog>
|
||||
Reference in New Issue
Block a user