[
https://issues.apache.org/jira/browse/FINERACT-1327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17317224#comment-17317224
]
Joseph Makara edited comment on FINERACT-1327 at 4/8/21, 2:36 PM:
------------------------------------------------------------------
Hi,
I was testing if Flyway has added a versioned script `V367` in FINERACT-1343
and realised `V366` is missing in the database
{code:java}
SELECT v.* FROM fineract_default.schema_version v ORDER BY v.installed_rank
DESC;{code}
On checking, it doesn't match the naming pattern. _Found naming errors on
`V366_remove_leading_or_trailing_spaces_in_reportnames.sql`_ (single 'V366_'
instead of double underscore 'V366__' used as separator)
In this case it is ignored during database migration.
[~francisguchie] Would you like to fix to correct filename at some point?:
V366__remove_leading_or_trailing_spaces_in_reportnames.sql
I would also suggest minor changes in`TenantDatabaseUpgradeService.java` and
add
_flyway.validateMigrationNaming = true_ config
in 2 places by replacing
{code:java}
.configuration(Map.of("flyway.table", "schema_version"){code}
with
{code:java}
.configuration(Map.of("flyway.table", "schema_version",
"flyway.validateMigrationNaming", "true")){code}
With the configuration option `_validateMigrationNaming = true_`, Flyway will
fail fast and list all files which need to be corrected.
Example
{code:java}
Invalid versioned migration name format:
V366_remove_leading_or_trailing_spaces_in_reportnames.sql (could not recognise
version number V366_remove_leading_or_trailing_spaces_in_reportnames.sql); for
Tenant DB URL: jdbc:mysql://localhost:3306/fineract_default, username: root
2021-04-08T15:18:52.925+0300 [INFO]
[org.gradle.api.internal.project.ant.AntLoggingAdapter] 2021-04-08 15:18:52.866
ERROR 13601 --- [ main] o.s.boot.SpringApplication: Application run failed
{code}
was (Author: josemakara):
Hi,
I was testing if Flyway has added a versioned script `V367` in FINERACT-1343
and realised `V366` is missing in the database
{code:java}
SELECT v.* FROM fineract_default.schema_version v ORDER BY v.installed_rank
DESC;{code}
On checking, it doesn't match the naming pattern. _Found naming errors on
`V366_remove_leading_or_trailing_spaces_in_reportnames.sql` (single '_V366__'
instead of double underscore '_V366___' used as separator)_
In this case it is ignored during database migration.
[~francisguchie] Would you like to fix to correct filename at some point?:
V366__remove_leading_or_trailing_spaces_in_reportnames.sql
I would also suggest minor changes in`TenantDatabaseUpgradeService.java` and
add
_flyway.validateMigrationNaming = true_ config
in 2 places by replacing
{code:java}
.configuration(Map.of("flyway.table", "schema_version"){code}
with
{code:java}
.configuration(Map.of("flyway.table", "schema_version",
"flyway.validateMigrationNaming", "true")){code}
With the configuration option `_validateMigrationNaming = true_`, Flyway will
fail fast and list all files which need to be corrected.
Example
{code:java}
Invalid versioned migration name format:
V366_remove_leading_or_trailing_spaces_in_reportnames.sql (could not recognise
version number V366_remove_leading_or_trailing_spaces_in_reportnames.sql); for
Tenant DB URL: jdbc:mysql://localhost:3306/fineract_default, username: root
2021-04-08T15:18:52.925+0300 [INFO]
[org.gradle.api.internal.project.ant.AntLoggingAdapter] 2021-04-08 15:18:52.866
ERROR 13601 --- [ main] o.s.boot.SpringApplication: Application run failed
{code}
> Report Names with trailing and leading spaces
> ---------------------------------------------
>
> Key: FINERACT-1327
> URL: https://issues.apache.org/jira/browse/FINERACT-1327
> Project: Apache Fineract
> Issue Type: Bug
> Components: Reports
> Affects Versions: 1.4.0
> Reporter: Francis Guchie
> Assignee: Francis Guchie
> Priority: Major
> Fix For: 1.5.0
>
>
> Some report names shipped in fineract under table stretchy report come with
> leading or trailing spaces. We need to have a migration script that cleans
> any such reports
--
This message was sent by Atlassian Jira
(v8.3.4#803005)