From 316290265ca651d3cb6bdf78dfd9c07aed376989 Mon Sep 17 00:00:00 2001 From: Ashhar Ahmad Khan <145142826+AshharAhmadKhan@users.noreply.github.com> Date: Mon, 3 Aug 2026 19:52:05 +0530 Subject: [PATCH] FINERACT-2736: Remove unused FineractEntityAccess (createEntityAccess/addNewEntityAccess dead since 2014/2016, no callers, no test coverage) createEntityAccess has been an empty stub returning null since the file was first created in 9d11434ee7 (Dec 6 2014). addNewEntityAccess had one caller until 66f8d7ce43 (June 9 2016) rewrote it to bypass the write service, leaving it with zero callers since. Removes FineractEntityAccess, its repository, repository wrapper, data class, constants, and configuration exception, along with the two dead methods and the m_entity_to_entity_access table. Leaves createEntityToEntityMapping/updateEntityToEntityMapping/deleteEntityToEntityMapping and the FineractEntityAccessUtil office-to-product access path untouched. Verified via full-repo grep, compileJava/compileTestJava, scoped spotless check, and Liquibase changeset well-formedness. No existing test coverage for this code, so none removed or added. --- .../FineractEntityAccessConstants.java | 50 ------- .../data/FineractEntityAccessData.java | 36 ----- .../domain/FineractEntityAccess.java | 128 ------------------ .../FineractEntityAccessRepository.java | 27 ---- ...FineractEntityAccessRepositoryWrapper.java | 55 -------- ...actEntityAccessConfigurationException.java | 33 ----- .../FineractEntityAccessWriteService.java | 11 -- .../FineractEntityAccessWriteServiceImpl.java | 30 +--- .../db/changelog/tenant/changelog-tenant.xml | 1 + .../0244_remove_unused_entity_access.xml | 26 ++++ .../migrations/sample_data/barebones_db.sql | 19 --- .../sample_data/load_sample_data.sql | 19 --- 12 files changed, 28 insertions(+), 407 deletions(-) delete mode 100644 fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/FineractEntityAccessConstants.java delete mode 100644 fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/data/FineractEntityAccessData.java delete mode 100644 fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityAccess.java delete mode 100644 fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityAccessRepository.java delete mode 100644 fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityAccessRepositoryWrapper.java delete mode 100644 fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/exception/FineractEntityAccessConfigurationException.java create mode 100644 fineract-provider/src/main/resources/db/changelog/tenant/parts/0244_remove_unused_entity_access.xml diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/FineractEntityAccessConstants.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/FineractEntityAccessConstants.java deleted file mode 100644 index 21859cd6eb0..00000000000 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/FineractEntityAccessConstants.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * 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. - */ -package org.apache.fineract.infrastructure.entityaccess; - -public final class FineractEntityAccessConstants { - - private FineractEntityAccessConstants() { - - } - - public static final String ENTITY_ACCESS_CODENAME = "Entity to Entity Access Types"; - - /*** - * Enum of all parameters passed in while creating/updating an entity access - ***/ - public enum EntityAccessJSONinputParams { - - ENTITY_TYPE("entityType"), // - ENTITY_ID("entityId"), // - ENTITY_ACCESS_TYPE_ID("entityAccessTypeId"), // - SECOND_ENTITY_TYPE("secondEntityType"), // - SECOND_ENTITY_ID("secondEntityId"); // - - private final String value; - - EntityAccessJSONinputParams(final String value) { - this.value = value; - } - - public String getValue() { - return this.value; - } - } -} diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/data/FineractEntityAccessData.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/data/FineractEntityAccessData.java deleted file mode 100644 index 1d79dde554f..00000000000 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/data/FineractEntityAccessData.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * 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. - */ -package org.apache.fineract.infrastructure.entityaccess.data; - -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; -import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntity; -import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntityAccessType; - -@Data -@NoArgsConstructor -@Accessors(chain = true) -public class FineractEntityAccessData { - - private FineractEntity firstEntity; - private FineractEntityAccessType accessType; - private FineractEntity secondEntity; - -} diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityAccess.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityAccess.java deleted file mode 100644 index f3184a71cdb..00000000000 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityAccess.java +++ /dev/null @@ -1,128 +0,0 @@ -/** - * 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. - */ -package org.apache.fineract.infrastructure.entityaccess.domain; - -import jakarta.persistence.Column; -import jakarta.persistence.Entity; -import jakarta.persistence.JoinColumn; -import jakarta.persistence.ManyToOne; -import jakarta.persistence.Table; -import java.util.LinkedHashMap; -import java.util.Map; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.experimental.Accessors; -import org.apache.fineract.infrastructure.codes.domain.CodeValue; -import org.apache.fineract.infrastructure.core.api.JsonCommand; -import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom; -import org.apache.fineract.infrastructure.entityaccess.FineractEntityAccessConstants; - -@Entity -@Table(name = "m_entity_to_entity_access") -@Getter -@Setter -@NoArgsConstructor -@Accessors(chain = true) -public class FineractEntityAccess extends AbstractPersistableCustom { - - @Column(name = "entity_type", length = 50) - private String entityType; - - @Column(name = "entity_id") - private Long entityId; - - @ManyToOne - @JoinColumn(name = "access_type_code_value_id", nullable = false) - private CodeValue accessType; - - @Column(name = "second_entity_type", length = 50) - private String secondEntityType; - - @Column(name = "second_entity_id") - private Long secondEntityId; - - public static FineractEntityAccess createNew(final String entityType, final Long entityId, final CodeValue accessType, - final String secondEntityType, final Long secondEntityId) { - return new FineractEntityAccess().setEntityType(entityType).setEntityId(entityId).setAccessType(accessType) - .setSecondEntityType(secondEntityType).setSecondEntityId(secondEntityId); - } - - public static FineractEntityAccess fromJson(final CodeValue accessType, final JsonCommand command) { - final String entityType = command - .stringValueOfParameterNamed(FineractEntityAccessConstants.EntityAccessJSONinputParams.ENTITY_TYPE.getValue()); - final Long entityId = command - .longValueOfParameterNamed(FineractEntityAccessConstants.EntityAccessJSONinputParams.ENTITY_ID.getValue()); - final String secondEntityType = command - .stringValueOfParameterNamed(FineractEntityAccessConstants.EntityAccessJSONinputParams.SECOND_ENTITY_ID.getValue()); - final Long secondEntityId = command - .longValueOfParameterNamed(FineractEntityAccessConstants.EntityAccessJSONinputParams.SECOND_ENTITY_ID.getValue()); - - return new FineractEntityAccess().setEntityType(entityType).setEntityId(entityId).setAccessType(accessType) - .setSecondEntityType(secondEntityType).setSecondEntityId(secondEntityId); - - } - - public Map update(final JsonCommand command) { - - final Map actualChanges = new LinkedHashMap<>(); - - String paramName = null; - - paramName = FineractEntityAccessConstants.EntityAccessJSONinputParams.ENTITY_TYPE.getValue(); - if (command.isChangeInStringParameterNamed(paramName, this.entityType)) { - final String newValue = command.stringValueOfParameterNamed(paramName); - actualChanges.put(paramName, newValue); - this.entityType = newValue; - } - - paramName = FineractEntityAccessConstants.EntityAccessJSONinputParams.ENTITY_ID.getValue(); - if (command.isChangeInLongParameterNamed(paramName, getEntityId())) { - this.entityId = command.longValueOfParameterNamed(paramName); - actualChanges.put(paramName, this.entityId); - } - - Long existingAccessTypeId = null; - if (this.accessType != null) { - existingAccessTypeId = this.accessType.getId(); - } - - paramName = FineractEntityAccessConstants.EntityAccessJSONinputParams.ENTITY_ACCESS_TYPE_ID.getValue(); - if (command.isChangeInLongParameterNamed(paramName, existingAccessTypeId)) { - final Long newValue = command.longValueOfParameterNamed(paramName); - actualChanges.put(paramName, newValue); - } - - paramName = FineractEntityAccessConstants.EntityAccessJSONinputParams.SECOND_ENTITY_TYPE.getValue(); - if (command.isChangeInStringParameterNamed(paramName, this.secondEntityType)) { - final String newValue = command.stringValueOfParameterNamed(paramName); - actualChanges.put(paramName, newValue); - this.secondEntityType = newValue; - } - - paramName = FineractEntityAccessConstants.EntityAccessJSONinputParams.SECOND_ENTITY_ID.getValue(); - if (command.isChangeInLongParameterNamed(paramName, getSecondEntityId())) { - this.secondEntityId = command.longValueOfParameterNamed(paramName); - actualChanges.put(paramName, this.secondEntityId); - } - - return actualChanges; - } - -} diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityAccessRepository.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityAccessRepository.java deleted file mode 100644 index 77701d46fe0..00000000000 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityAccessRepository.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * 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. - */ -package org.apache.fineract.infrastructure.entityaccess.domain; - -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; - -public interface FineractEntityAccessRepository - extends JpaRepository, JpaSpecificationExecutor { - // no added behaviour -} diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityAccessRepositoryWrapper.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityAccessRepositoryWrapper.java deleted file mode 100644 index f0010ef075e..00000000000 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityAccessRepositoryWrapper.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * 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. - */ -package org.apache.fineract.infrastructure.entityaccess.domain; - -import org.apache.fineract.infrastructure.entityaccess.exception.FineractEntityAccessNotFoundException; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -/** - *

- * Wrapper for {@link FineractEntityAccessRepository} that adds NULL checking and Error handling capabilities - *

- */ -@Service -public class FineractEntityAccessRepositoryWrapper { - - private final FineractEntityAccessRepository repository; - - @Autowired - public FineractEntityAccessRepositoryWrapper(final FineractEntityAccessRepository repository) { - this.repository = repository; - } - - public FineractEntityAccess findOneWithNotFoundDetection(final Long id) { - return this.repository.findById(id).orElseThrow(() -> new FineractEntityAccessNotFoundException(id)); - } - - public void save(final FineractEntityAccess fineractEntityAccess) { - this.repository.save(fineractEntityAccess); - } - - public void saveAndFlush(final FineractEntityAccess fineractEntityAccess) { - this.repository.saveAndFlush(fineractEntityAccess); - } - - public void delete(final FineractEntityAccess fineractEntityAccess) { - this.repository.delete(fineractEntityAccess); - } -} diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/exception/FineractEntityAccessConfigurationException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/exception/FineractEntityAccessConfigurationException.java deleted file mode 100644 index 0b30725c7c4..00000000000 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/exception/FineractEntityAccessConfigurationException.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * 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. - */ -package org.apache.fineract.infrastructure.entityaccess.exception; - -import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; -import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntityAccessType; -import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntityType; - -public class FineractEntityAccessConfigurationException extends AbstractPlatformDomainRuleException { - - public FineractEntityAccessConfigurationException(final Long firstEntityId, final FineractEntityType entityType1, - final FineractEntityAccessType accessType, final FineractEntityType entityType2) { - super("error.msg.entityaccess.config", "Error while getting entity access configuration for " + entityType1.getType() + ":" - + firstEntityId + " with type " + accessType.getStr() + " against " + entityType2.getType()); - } - -} diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessWriteService.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessWriteService.java index 25afdb9a864..36b54096107 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessWriteService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessWriteService.java @@ -18,26 +18,15 @@ */ package org.apache.fineract.infrastructure.entityaccess.service; -import org.apache.fineract.infrastructure.codes.domain.CodeValue; import org.apache.fineract.infrastructure.core.api.JsonCommand; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; public interface FineractEntityAccessWriteService { - CommandProcessingResult createEntityAccess(JsonCommand command); - CommandProcessingResult createEntityToEntityMapping(Long relId, JsonCommand command); CommandProcessingResult updateEntityToEntityMapping(Long mapId, JsonCommand command); CommandProcessingResult deleteEntityToEntityMapping(Long mapId); - void addNewEntityAccess(String entityType, Long entityId, CodeValue accessType, String secondEntityType, Long secondEntityId); - - /* - * CommandProcessingResult updateEntityAccess ( Long entityAccessId, JsonCommand command); - * - * CommandProcessingResult removeEntityAccess ( String entityType, Long entityId, Long accessType, String - * secondEntityType, Long secondEntityId); - */ } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessWriteServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessWriteServiceImpl.java index d5a2ab64582..36f41934304 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessWriteServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessWriteServiceImpl.java @@ -22,7 +22,6 @@ import java.time.LocalDate; import java.util.Map; import org.apache.commons.lang3.exception.ExceptionUtils; -import org.apache.fineract.infrastructure.codes.domain.CodeValue; import org.apache.fineract.infrastructure.core.api.JsonCommand; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.data.CommandProcessingResultBuilder; @@ -31,8 +30,6 @@ import org.apache.fineract.infrastructure.core.service.DateUtils; import org.apache.fineract.infrastructure.entityaccess.api.FineractEntityApiResourceConstants; import org.apache.fineract.infrastructure.entityaccess.data.FineractEntityDataValidator; -import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntityAccess; -import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntityAccessRepository; import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntityRelation; import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntityRelationRepositoryWrapper; import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntityToEntityMapping; @@ -51,40 +48,22 @@ public class FineractEntityAccessWriteServiceImpl implements FineractEntityAccessWriteService { private static final Logger LOG = LoggerFactory.getLogger(FineractEntityAccessWriteServiceImpl.class); - private final FineractEntityAccessRepository entityAccessRepository; private final FineractEntityRelationRepositoryWrapper fineractEntityRelationRepositoryWrapper; private final FineractEntityToEntityMappingRepository fineractEntityToEntityMappingRepository; private final FineractEntityToEntityMappingRepositoryWrapper fineractEntityToEntityMappingRepositoryWrapper; private final FineractEntityDataValidator fromApiJsonDeserializer; @Autowired - public FineractEntityAccessWriteServiceImpl(final FineractEntityAccessRepository entityAccessRepository, - final FineractEntityRelationRepositoryWrapper fineractEntityRelationRepositoryWrapper, + public FineractEntityAccessWriteServiceImpl(final FineractEntityRelationRepositoryWrapper fineractEntityRelationRepositoryWrapper, final FineractEntityToEntityMappingRepository fineractEntityToEntityMappingRepository, final FineractEntityToEntityMappingRepositoryWrapper fineractEntityToEntityMappingRepositoryWrapper, FineractEntityDataValidator fromApiJsonDeserializer) { - this.entityAccessRepository = entityAccessRepository; this.fineractEntityToEntityMappingRepository = fineractEntityToEntityMappingRepository; this.fromApiJsonDeserializer = fromApiJsonDeserializer; this.fineractEntityRelationRepositoryWrapper = fineractEntityRelationRepositoryWrapper; this.fineractEntityToEntityMappingRepositoryWrapper = fineractEntityToEntityMappingRepositoryWrapper; } - @Override - public CommandProcessingResult createEntityAccess(@SuppressWarnings("unused") JsonCommand command) { - // TODO Auto-generated method stub - return null; - } - - @Override - @Transactional - public void addNewEntityAccess(final String entityType, final Long entityId, final CodeValue accessType, final String secondEntityType, - final Long secondEntityId) { - FineractEntityAccess entityAccess = FineractEntityAccess.createNew(entityType, entityId, accessType, secondEntityType, - secondEntityId); - entityAccessRepository.save(entityAccess); - } - @Override @Transactional public CommandProcessingResult createEntityToEntityMapping(Long relId, JsonCommand command) { @@ -182,11 +161,4 @@ private void handleDataIntegrityIssues(final JsonCommand command, final Throwabl throw ErrorHandler.getMappable(dve, "error.msg.entity.mapping", "Unknown data integrity issue with resource."); } - /* - * @Override public CommandProcessingResult updateEntityAccess(Long entityAccessId, JsonCommand command) { // TODO - * Auto-generated method stub return null; } - * - * @Override public CommandProcessingResult removeEntityAccess(String entityType, Long entityId, Long accessType, - * String secondEntityType, Long secondEntityId) { // TODO Auto-generated method stub return null; } - */ } diff --git a/fineract-provider/src/main/resources/db/changelog/tenant/changelog-tenant.xml b/fineract-provider/src/main/resources/db/changelog/tenant/changelog-tenant.xml index a5997753af8..6674c98ec0e 100644 --- a/fineract-provider/src/main/resources/db/changelog/tenant/changelog-tenant.xml +++ b/fineract-provider/src/main/resources/db/changelog/tenant/changelog-tenant.xml @@ -262,4 +262,5 @@ + diff --git a/fineract-provider/src/main/resources/db/changelog/tenant/parts/0244_remove_unused_entity_access.xml b/fineract-provider/src/main/resources/db/changelog/tenant/parts/0244_remove_unused_entity_access.xml new file mode 100644 index 00000000000..622a5b02e81 --- /dev/null +++ b/fineract-provider/src/main/resources/db/changelog/tenant/parts/0244_remove_unused_entity_access.xml @@ -0,0 +1,26 @@ + + + + + + + diff --git a/fineract-provider/src/main/resources/sql/migrations/sample_data/barebones_db.sql b/fineract-provider/src/main/resources/sql/migrations/sample_data/barebones_db.sql index 8e7642fb469..45d49b6a109 100644 --- a/fineract-provider/src/main/resources/sql/migrations/sample_data/barebones_db.sql +++ b/fineract-provider/src/main/resources/sql/migrations/sample_data/barebones_db.sql @@ -1624,25 +1624,6 @@ INSERT INTO `m_entity_relation` (`id`, `from_entity_type`, `to_entity_type`, `co /*!40000 ALTER TABLE `m_entity_relation` ENABLE KEYS */; --- Dumping structure for table fineract_default.m_entity_to_entity_access -DROP TABLE IF EXISTS `m_entity_to_entity_access`; -CREATE TABLE IF NOT EXISTS `m_entity_to_entity_access` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `entity_type` varchar(50) NOT NULL, - `entity_id` BIGINT NOT NULL, - `access_type_code_value_id` INT NOT NULL, - `second_entity_type` varchar(50) NOT NULL, - `second_entity_id` BIGINT NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `id_uniq_m_entity_to_entity_access` (`entity_type`,`entity_id`,`access_type_code_value_id`,`second_entity_type`,`second_entity_id`), - KEY `IDX_OFFICE` (`entity_type`,`entity_id`), - KEY `FK_access_type_code_m_code_value` (`access_type_code_value_id`), - CONSTRAINT `FK_access_type_code_m_code_value` FOREIGN KEY (`access_type_code_value_id`) REFERENCES `m_code_value` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - --- Dumping data for table fineract_default.m_entity_to_entity_access: ~0 rows (approximately) -/*!40000 ALTER TABLE `m_entity_to_entity_access` DISABLE KEYS */; -/*!40000 ALTER TABLE `m_entity_to_entity_access` ENABLE KEYS */; -- Dumping structure for table fineract_default.m_entity_to_entity_mapping diff --git a/fineract-provider/src/main/resources/sql/migrations/sample_data/load_sample_data.sql b/fineract-provider/src/main/resources/sql/migrations/sample_data/load_sample_data.sql index 9747ff30160..928125372a1 100644 --- a/fineract-provider/src/main/resources/sql/migrations/sample_data/load_sample_data.sql +++ b/fineract-provider/src/main/resources/sql/migrations/sample_data/load_sample_data.sql @@ -1750,25 +1750,6 @@ INSERT INTO `m_entity_relation` (`id`, `from_entity_type`, `to_entity_type`, `co /*!40000 ALTER TABLE `m_entity_relation` ENABLE KEYS */; --- Dumping structure for table mifostenant-reference.m_entity_to_entity_access -DROP TABLE IF EXISTS `m_entity_to_entity_access`; -CREATE TABLE IF NOT EXISTS `m_entity_to_entity_access` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `entity_type` varchar(50) NOT NULL, - `entity_id` BIGINT NOT NULL, - `access_type_code_value_id` INT NOT NULL, - `second_entity_type` varchar(50) NOT NULL, - `second_entity_id` BIGINT NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `id_uniq_m_entity_to_entity_access` (`entity_type`,`entity_id`,`access_type_code_value_id`,`second_entity_type`,`second_entity_id`), - KEY `IDX_OFFICE` (`entity_type`,`entity_id`), - KEY `FK_access_type_code_m_code_value` (`access_type_code_value_id`), - CONSTRAINT `FK_access_type_code_m_code_value` FOREIGN KEY (`access_type_code_value_id`) REFERENCES `m_code_value` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - --- Dumping data for table mifostenant-reference.m_entity_to_entity_access: ~0 rows (approximately) -/*!40000 ALTER TABLE `m_entity_to_entity_access` DISABLE KEYS */; -/*!40000 ALTER TABLE `m_entity_to_entity_access` ENABLE KEYS */; -- Dumping structure for table mifostenant-reference.m_entity_to_entity_mapping