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.

-schemas causing schema version `null`

See original GitHub issue
Which version and edition of Flyway are you using?

docker flyway/flyway 7.5.0

If this is not the latest version, can you reproduce the issue with the latest one as well? (Many bugs are fixed in newer releases and upgrading will often resolve the issue)
Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)

CLI

Which database are you using? (Type & version)

postgres 9.5

Which operating system are you using?

docker on Linux

What did you do? (Please include the content causing the issue, any relevant configuration settings, the SQL statement(s) that failed (if any), and the command you ran)

There is not configuration file present and no jars, this is a plain usage of the docker image together with a postgres database.

command (inside the docker container): flyway -user=... -password=... -schemas=my_schema -url=jdbc:postgresql://db:5432/postgres migrate

SQL on /flyway/sql/V1__Initial.sql (mounted):

CREATE TABLE my_schema.table (
    my_test INTEGER NOT NULL,
    ... 
)
What did you expect to see?

The migration be applied.

What did you see instead?
Creating schema "my_schema" ...
Creating Schema History table "my_schema"."flyway_schema_history" ...
Current version of schema "my_schema": null
Schema "my_schema" is up to data. No migration necessary.

When -schema=my_schema is not passed (and CREATE TABLE does not include it) the migration is applied correctly.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
jorgecarleitaocommented, Jan 20, 2021

Thanks a lot for your help, “-X” really helped solving the problem. The sql directory was incorrectly mounted, which caused the sql files to be empty. Funny that it did not said that there were no files, but that is beyond the point.

Thanks a lot both for your help.

0reactions
teotwakicommented, Jan 20, 2021

Hi @jorgecarleitao,

Did you extract the DDL from the existing database? As far as I understand, Flyway can’t apply new changes if it doesn’t have a starting point.

https://flywaydb.org/documentation/learnmore/existing

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I resolve issues with missing or incorrect schema ...
The database version check SQL is SELECT PROPVALUE FROM LSW_SYSTEM_SCHEMA WHERE upper(PROPNAME) = upper('DatabaseSchemaVersion') Please ensure the database is ...
Read more >
schemaId is null when attempting to discover schema SCIM 2.0
I was able to resolve this issue by fixing the /ResourceTypes response. The schemas value for ListResponse was incorrectly formatted. Original:
Read more >
Schema related problems with Flyway / Spring and H2 ...
Setting this to "false" is experimental. When set to false, all identifier names (table names, column names) are case sensitive... the problem is...
Read more >
Schema for CSFLE with null values - MongoDB
Hi,. I am trying to use Client-Side-Field-Level-Encryption (CSFLE) ; So far I am providing the schemaMap in the autoEncryption property when ...
Read more >
How to Version SQL Server Database Schema - Coding Helmet
Solution is designed around a single table which tracks schema version changes. A couple of stored procedures are provided to back up required ......
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