oracle: existing jobs should not cause the schema to be not-empty
Which version and edition of Flyway are you using?
10.9.1
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)
JAVA API, from spring app
Which database are you using? (Type & version)
Oracle 19
Which operating system are you using?
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)
Step 1. Drop every user object from schema (cascade, purge)
select count() from user_objects where OBJECT_TYPE!='JOB' = 0 select count() from user_objects where OBJECT_TYPE='JOB' > 0
Step 2. Run migration (spring app startup)
What did you expect to see?
Migration succeeds
What did you see instead?
org.flywaydb.core.api.FlywayException: Found non-empty schema(s) "xxx" but no schema history table. Use baseline() or set baselineOnMigrate to true to initialize the schema history table.
After investigating, in class OracleSchema, method supportedTypesExist , we get a false positive , because there are JOBs select count() from user_objects where OBJECT_TYPE='JOB' > 0 select count() from user_objects where OBJECT_TYPE!='JOB' = 0 This should not cause the schema to be not empty.
Source: flyway/flyway