Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public CommandProcessingResult deleteTeller(Long tellerId) {
* Guaranteed to throw an exception no matter what the data integrity issue is.
*/
private void handleTellerDataIntegrityIssues(final JsonCommand command, final Throwable realCause, final Exception dve) {
if (realCause.getMessage().contains("m_tellers_name_unq")) {
if (realCause.getMessage().contains("m_tellers_office_name_unq")) {
final String name = command.stringValueOfParameterNamed("name");
throw new PlatformDataIntegrityException("error.msg.teller.duplicate.name", "Teller with name `" + name + "` already exists",
"name", name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,4 +259,5 @@
<include file="parts/0238_transaction_summary_report_update_originator_inline_join.xml" relativeToChangelogFile="true" />
<include file="parts/0239_add_retained_earning_job.xml" relativeToChangelogFile="true"/>
<include file="parts/0240_add_retained_earning_global_configuration.xml" relativeToChangelogFile="true"/>
<include file="parts/0242_update_m_tellers_unique_key.xml" relativeToChangelogFile="true" />
</databaseChangeLog>
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?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="mysql">
<preConditions onFail="MARK_RAN">
<indexExists tableName="m_tellers" indexName="name"/>
</preConditions>
<sql>ALTER TABLE m_tellers DROP INDEX name</sql>
<addUniqueConstraint columnNames="office_id, name" constraintName="m_tellers_office_name_unq" tableName="m_tellers" />
</changeSet>
<changeSet author="fineract" id="1" context="postgresql">
<preConditions onFail="MARK_RAN">
<indexExists tableName="m_tellers" indexName="m_tellers_name_key"/>
</preConditions>
<dropUniqueConstraint tableName="m_tellers" constraintName="m_tellers_name_key"/>
<addUniqueConstraint columnNames="office_id, name" constraintName="m_tellers_office_name_unq" tableName="m_tellers" />
</changeSet>
</databaseChangeLog>
Original file line number Diff line number Diff line change
Expand Up @@ -5291,7 +5291,7 @@ CREATE TABLE IF NOT EXISTS `m_tellers` (
`valid_to` date DEFAULT NULL,
`state` SMALLINT DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `m_tellers_name_unq` (`name`),
UNIQUE KEY `m_tellers_office_name_unq` (`office_id`, `name`),
KEY `IK_m_tellers_m_office` (`office_id`),
KEY `FK_m_tellers_gl_account_debit_account_id` (`debit_account_id`),
KEY `FK_m_tellers_gl_account_credit_account_id` (`credit_account_id`),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5548,7 +5548,7 @@ CREATE TABLE IF NOT EXISTS `m_tellers` (
`valid_to` date DEFAULT NULL,
`state` SMALLINT DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `m_tellers_name_unq` (`name`),
UNIQUE KEY `m_tellers_office_name_unq` (`office_id`, `name`),
KEY `IK_m_tellers_m_office` (`office_id`),
KEY `FK_m_tellers_gl_account_debit_account_id` (`debit_account_id`),
KEY `FK_m_tellers_gl_account_credit_account_id` (`credit_account_id`),
Expand Down
Loading
Loading