Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flyway unable to drop schema during cleanup when a user defined type is used #3174

Closed
AigleeK opened this issue May 17, 2021 · 2 comments
Closed

Comments

@AigleeK
Copy link

AigleeK commented May 17, 2021

Which version and edition of Flyway are you using?

Flyway 7.9.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)

Latest

Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)

Command-Line

Which database are you using? (Type & version)

SQL Server 2017

Which operating system are you using?

Windows

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)

Execute migrate
It works successfully
Execute clean
It fails to drop Utility schema

Use the following configuration file:
flyway.url=jdbc:sqlserver://localhost;database=Test;integratedSecurity=true
flyway.locations=filesystem:Test
flyway.table=VER_FLYWAY_MIGRATION_HISTORY
flyway.defaultSchema=dbo
flyway.schemas=dbo,Framework,Utility

Test folder is below:
Test.zip

What did you expect to see?

It should drop the schemas but it fails to clean types

What did you see instead?

image

@DoodleBobBuffPants
Copy link
Contributor

This is expected behavior - the schema cannot be dropped due to the type, so we clean the schema instead. We will consider attempting to drop the schema again after this clean, as the type shouldn't be a problem at this point

@AigleeK
Copy link
Author

AigleeK commented May 18, 2021

It makes no sense that's expected behavior because if you do that, run the clean, it doesn't drop the schema, it cleans it, and then you run a migrate, it FAILS. It tells you the schema already exists because is trying to create it. So either the clean needs to drop it or the migrate needs to not fail if it already exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants