Clean improvements for Oracle pt.2 #1601
Merged
Conversation
8 commits
Mar 30, 2017
added Oracle improve clean
Schema object types moved to a enum, encapsulating drop logic.
@vosolovskiy Can you get in touch with me via email? (axel at boxfuse.com) Thanks! |
2 commits
Jun 4, 2017
added In disableFlashbackArchiveForFbaTrackedTables() we use DBA_FLASHBACK_ARCHIVE_TABLES, which is granted to PUBLIC by default. If it is not, there may be a error even if FBA is not used. To avoid this, USER_ view now used if DBA_ view is not accessible and the cleaned schema is current user's own schema.
axelfontaine
added a commit
that referenced
this pull request
Aug 24, 2017
@vosolovskiy Thanks. Merged!I had to disable one test for XE. As you may have noticed we have started transitioning Flyway testing to Docker containers to make it easier for contributors to have consistent dev environments. One test ( |
axelfontaine
added a commit
to flyway/flywaydb.org
that referenced
this pull request
Aug 24, 2017
@axelfontaine cool, thanx! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
This PR is to address the rest of flaws mentioned in issue #1550. This PR continues my previous PR #1573.
The main goal of this change is to simplify
OracleSchema.doClean()
method and extend it with more object types. Logic of finding and dropping of objects of certain types was encapsulated into correspondingOracleSchema.ObjectType
enum values.The list of new object types that get dropped during Clean phase:
There are also object types that are intentionally ignored during Clean phase, because they contain sensitive information (passwords for external resources) and not always can be re-created via standard Flyway workflow:
Other ignored schema-owned types (tricky or undocumented):
Unlike the previous implementation, which silently ignored most of unsupported types, in the new version all the ignored (non-droppable) types cause warnings in the log if found in the target schema and still can be explicitly dropped with an afterClean-callback. Even if not cleaned, they don't break migration from scratch after full cleaning - Flyway sees them during Clean phase but doesn't see them during
isEmpty()
check and doesn't throw an exception.Medium tests were improved to support different Oracle environments. JUnit assumptions on Oracle version and edition were added where needed, so that some tests are automatically ignored if the target database doesn't support the tested feature. There's no need to set/unset
@Ignore
annotation manually any more.This change has been successfully tested on the following Oracle versions/editions: