question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Flyway will not scan classpath locations if they contains a dot in directory name

See original GitHub issue

Our directory structure for static SQL migration files contains a dot (‘.’) in the directory name. If these files a all part of a resource Jar and we will now configure Flyway with location starting direct with this directory it will not find any migration file.

Example Directory structure: archive-2.6 … archive-3.3

...locations=classpath:archive-3.3, classpath:/org/archive/migrations

Following workaround works:

  • replace ‘.’ with ‘_’ 😃
  • add a parent directory ‘sql’ and configure locations=classpath:sql, classpath:... , but now we scan some directories we won’t have in the scan.

I take a look into the implementation of Location and see path.replace(".", "/");. First I think may a quot for dot support will help.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
dkellenbcommented, Mar 13, 2018

I stumbled across the same issue today. Would be good to have it fixed. Scanning for folders without the replacements and with the replacements of . sounds good.

0reactions
DoodleBobBuffPantscommented, Sep 3, 2020

This feature is now available in the V7 beta which you can read more about here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Locations - Flyway by Redgate • Database Migrations Made ...
Locations. Description. Comma-separated list of locations to scan recursively for migrations. The location type is determined by its prefix.
Read more >
Flyway can't find classpath:db/migrations - Stack Overflow
Go to the resource folder -> Create DB folder -> Create migration folder -> Create database file with Version_SubVersion__Name(As defined below) ...
Read more >
Introduction of Flyway with Spring Boot | by Guster - Medium
You can think of Flyway as version control for your database. ... Inside the migration file contains the pure SQL statements. For example:...
Read more >
Flyway - Database migrations made easy | Novatec
If you have an existing database that has not been filled by Flyway, ... it's important to customize the name of the migration...
Read more >
Flyway Integration With Spring - Humble Bits - Quovantis
If this table is not found then it will create this database. After the creation of the database, Flyway scans the classpath for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found