You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fineract.apache.org by "Hitesh Prajapati (Jira)" <ji...@apache.org> on 2023/05/14 10:00:00 UTC

[jira] (FINERACT-1930) Migration issue - upgrade from fineract 1.6.0

    [ https://issues.apache.org/jira/browse/FINERACT-1930 ]


    Hitesh Prajapati deleted comment on FINERACT-1930:
    --------------------------------------------

was (Author: hitesh.kams.prajapati):
[~aleks] : I have raised the PR For this - [https://github.com/apache/fineract/pull/3173]

> Migration issue - upgrade from fineract 1.6.0 
> ----------------------------------------------
>
>                 Key: FINERACT-1930
>                 URL: https://issues.apache.org/jira/browse/FINERACT-1930
>             Project: Apache Fineract
>          Issue Type: Bug
>          Components: Migration Scripts
>            Reporter: Hitesh Prajapati
>            Priority: Minor
>
> The migration script 0016_changed_unique_constraint_of_ref_no.xml failed while migrating from fineract 1.6.0 to 1.8.4
>  
> =====
> This is due to mismatch of unique constraint name.
> This is because the fineract 1.6.0 schema has the unique constraint in m_savings_account_transaction table with name 'transaction_ref_no' as  per V391__add_transaction_ref_column.sql.
> But migration script - 0016_changed_unique_constraint_of_ref_no.xml - is using the name 'ref_no'
>  
> {code:java}
> Error while migrating the schema
>         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804)
>         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620)
>         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
>         at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
>         at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
>         at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
>         at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
>         at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
>         at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
>         at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:330)
>         ... 105 common frames omitted
> Caused by: java.lang.RuntimeException: Error while migrating the schema
>         at org.apache.fineract.infrastructure.core.service.migration.TenantDatabaseUpgradeService.afterPropertiesSet(TenantDatabaseUpgradeService.java:82)
>         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863)
>         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800)
>         ... 114 common frames omitted
> Caused by: liquibase.exception.LiquibaseException: liquibase.exception.MigrationFailedException: Migration failed for change set db/changelog/tenant/parts/0016_changed_unique_constraint_of_ref_no.xml::1::fineract:
>      Reason: liquibase.exception.DatabaseException: (conn=53) Can't DROP INDEX `ref_no`; check that it exists [Failed SQL: (1091) ALTER TABLE fineract_default.m_savings_account_transaction DROP KEY ref_no]
>         at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:126)
>         at liquibase.Liquibase.lambda$null$0(Liquibase.java:262)
>         at liquibase.Scope.lambda$child$0(Scope.java:180)
>         at liquibase.Scope.child(Scope.java:189)
>         at liquibase.Scope.child(Scope.java:179)
>         at liquibase.Scope.child(Scope.java:158)
>         at liquibase.Scope.child(Scope.java:243)
>         at liquibase.Liquibase.lambda$update$1(Liquibase.java:261)
>         at liquibase.Scope.lambda$child$0(Scope.java:180)
>         at liquibase.Scope.child(Scope.java:189)
>         at liquibase.Scope.child(Scope.java:179)
>         at liquibase.Scope.child(Scope.java:158)
>         at liquibase.Liquibase.runInScope(Liquibase.java:2400)
>         at liquibase.Liquibase.update(Liquibase.java:208)
>         at liquibase.Liquibase.update(Liquibase.java:194)
>         at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:314)
>         at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:269)
>         at org.apache.fineract.infrastructure.core.service.migration.TenantDatabaseUpgradeService.upgradeIndividualTenant(TenantDatabaseUpgradeService.java:129)
>         at org.apache.fineract.infrastructure.core.service.migration.TenantDatabaseUpgradeService.upgradeIndividualTenants(TenantDatabaseUpgradeService.java:114)
>         at org.apache.fineract.infrastructure.core.service.migration.TenantDatabaseUpgradeService.afterPropertiesSet(TenantDatabaseUpgradeService.java:80)
>         ... 116 common frames omitted
> Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set db/changelog/tenant/parts/0016_changed_unique_constraint_of_ref_no.xml::1::fineract:
>      Reason: liquibase.exception.DatabaseException: (conn=53) Can't DROP INDEX `ref_no`; check that it exists [Failed SQL: (1091) ALTER TABLE fineract_default.m_savings_account_transaction DROP KEY ref_no]
>         at liquibase.changelog.ChangeSet.execute(ChangeSet.java:701)
>         at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:56)
>         at liquibase.changelog.ChangeLogIterator$2.lambda$null$0(ChangeLogIterator.java:113)
>         at liquibase.Scope.lambda$child$0(Scope.java:180)
>         at liquibase.Scope.child(Scope.java:189)
>         at liquibase.Scope.child(Scope.java:179)
>         at liquibase.Scope.child(Scope.java:158)
>         at liquibase.changelog.ChangeLogIterator$2.lambda$run$1(ChangeLogIterator.java:112)
>         at liquibase.Scope.lambda$child$0(Scope.java:180)
>         at liquibase.Scope.child(Scope.java:189)
>         at liquibase.Scope.child(Scope.java:179)
>         at liquibase.Scope.child(Scope.java:158)
>         at liquibase.Scope.child(Scope.java:243)
>         at liquibase.changelog.ChangeLogIterator$2.run(ChangeLogIterator.java:93)
>         at liquibase.Scope.lambda$child$0(Scope.java:180)
>         at liquibase.Scope.child(Scope.java:189)
>         at liquibase.Scope.child(Scope.java:179)
>         at liquibase.Scope.child(Scope.java:158)
>         at liquibase.Scope.child(Scope.java:243)
>         at liquibase.Scope.child(Scope.java:247)
>         at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:65)
>         ... 135 common frames omitted
> Caused by: liquibase.exception.DatabaseException: (conn=53) Can't DROP INDEX `ref_no`; check that it exists [Failed SQL: (1091) ALTER TABLE fineract_default.m_savings_account_transaction DROP KEY ref_no]
>         at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:434)
>         at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:77)
>         at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:160)
>         at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1304)
>         at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1286)
>         at liquibase.changelog.ChangeSet.execute(ChangeSet.java:666)
>         ... 155 common frames omitted
> Caused by: java.sql.SQLSyntaxErrorException: (conn=53) Can't DROP INDEX `ref_no`; check that it exists
>         at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.createException(ExceptionFactory.java:62)
>         at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.create(ExceptionFactory.java:158)
>         at org.mariadb.jdbc.MariaDbStatement.executeExceptionEpilogue(MariaDbStatement.java:262)
>         at org.mariadb.jdbc.MariaDbStatement.executeInternal(MariaDbStatement.java:362)
>         at org.mariadb.jdbc.MariaDbStatement.execute(MariaDbStatement.java:500)
>         at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:94)
>         at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java)
>         at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:430)
>         ... 160 common frames omitted
> Caused by: org.mariadb.jdbc.internal.util.exceptions.MariaDbSqlException: Can't DROP INDEX `ref_no`; check that it exists
>         at org.mariadb.jdbc.internal.util.exceptions.MariaDbSqlException.of(MariaDbSqlException.java:34)
>         at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.exceptionWithQuery(AbstractQueryProtocol.java:194)
>         at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery(AbstractQueryProtocol.java:262)
>         at org.mariadb.jdbc.MariaDbStatement.executeInternal(MariaDbStatement.java:356)
>         ... 164 common frames omitted
> Caused by: java.sql.SQLException: Can't DROP INDEX `ref_no`; check that it exists
>         at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.readErrorPacket(AbstractQueryProtocol.java:1695)
>         at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.readPacket(AbstractQueryProtocol.java:1557)
>         at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.getResult(AbstractQueryProtocol.java:1520)
>         at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery(AbstractQueryProtocol.java:256)
>         ... 165 common frames omitted{code}
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)