[
https://issues.apache.org/jira/browse/FINERACT-1930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Hitesh Prajapati updated FINERACT-1930:
---------------------------------------
Description:
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}
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'tenantDatabaseUpgradeService' defined in URL
[jar:file:/D:/Work/source/fineract/fineract-provider/build/libs/fineract-provider-1.8.5-f41a1210.jar!/BOOT-INF/classes!/org/apache/fineract/infrastructure/core/service/migration/TenantDatabaseUpgradeService.class]:
Invocation of init method failed; nested exception is
java.lang.RuntimeException: 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=11) Can't DROP INDEX
`ref_no`; check that it exists [Failed SQL: (1091) ALTER TABLE
fineract_test.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=11) Can't DROP INDEX
`ref_no`; check that it exists [Failed SQL: (1091) ALTER TABLE
fineract_test.m_savings_account_transaction DROP KEY ref_no]
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:701){code}
was:
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}
{code}
> 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}
> Caused by: org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'tenantDatabaseUpgradeService' defined in URL
> [jar:file:/D:/Work/source/fineract/fineract-provider/build/libs/fineract-provider-1.8.5-f41a1210.jar!/BOOT-INF/classes!/org/apache/fineract/infrastructure/core/service/migration/TenantDatabaseUpgradeService.class]:
> Invocation of init method failed; nested exception is
> java.lang.RuntimeException: 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=11) Can't DROP
> INDEX `ref_no`; check that it exists [Failed SQL: (1091) ALTER TABLE
> fineract_test.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=11) Can't DROP
> INDEX `ref_no`; check that it exists [Failed SQL: (1091) ALTER TABLE
> fineract_test.m_savings_account_transaction DROP KEY ref_no]
> at liquibase.changelog.ChangeSet.execute(ChangeSet.java:701){code}
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)