-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
generateChangelog optionally creates runOnChange=true and replaceIfExists=true for createView changes #4635
Conversation
…ists=true for createView changes
…aceIfExists=true for createView changes Comma-separated list of change types instead of true/false allows to specify createProcedure besides createView
|
…aceIfExists=true for createView changes New interface ReplaceIfExists instead of list of distinct classes
…aceIfExists=true for createView changes New interface ReplaceIfExists removes the need for if-instanceof.
…aceIfExists=true for createView changes Dynamically detects available implementations of ReplaceIfExists.
…aceIfExists=true for createView changes Validating --replace-if-exists-types and --run-on-change-types
…mkarg-issue-4634
liquibase-standard/src/main/java/liquibase/command/core/GenerateChangelogCommandStep.java
Fixed
Show resolved
Hide resolved
liquibase-standard/src/main/java/liquibase/change/core/CreateProcedureChange.java
Dismissed
Show resolved
Hide resolved
liquibase-standard/src/main/java/liquibase/change/core/CreateViewChange.java
Dismissed
Show resolved
Hide resolved
liquibase-standard/src/main/java/liquibase/diff/output/changelog/DiffToChangeLog.java
Show resolved
Hide resolved
liquibase-standard/src/main/java/liquibase/command/core/GenerateChangelogCommandStep.java
Outdated
Show resolved
Hide resolved
Hi @mkarg, I left two review comments (one it's a very minor thing, though). Could you please look at them? I was planning to add some integration test to do something like this:
for which probably better to use |
@MalloD12 I am PTO this week and look into this next week. |
Hi @mkarg, Have you had a chance to look at my comments? Thanks, |
…ngelog command step classes. - Renamed arguments. - Updated tests.
…mkarg-issue-4634
I've manually tested this PR, using both
The point of this was to try being as thorough as possible, with some of the most widely used databases. Here are the results:It works as expected for file types xml, yml and json, for all 4 tested databases and both commands. There are some problems with the sql files for all 4 databases. I'll specify them below. All databases PostgreSQL, Oracle, MySQL
The statement Oracle PostgreSQL
The That's all I found. Let me know if there is anything else I can help with. |
@MalloD12 can you review @tati-qalified comments? thanks! |
Thanks @tati-qalified for your very detailed testing. I think these "issues"/inconsistencies are not because of these changes. For example, in the case of Regarding the "drop procedure" statement you are right it shouldn't be there, but again this is an existent piece in the code I would recommend similarly to the previous finding to deal with in a separate issue. I think the same applies to the other findings. Again, I would recommend dealing with each of these findings separately, so we don't keep this ticket on hold more time since these findings haven't been introduced with this PR. What do you think @filipelautert - @rberezen - @tati-qalified? Thanks, |
… CreateView and CreateProcedure objects from maven.
…mkarg-issue-4634
@MalloD12, I agree with you on creating a separate issue for the problems described |
Sounds good to me |
# Conflicts: # liquibase-integration-tests/src/test/groovy/liquibase/command/core/GenerateChangeLogMySQLIntegrationTest.groovy # liquibase-integration-tests/src/test/groovy/liquibase/diffchangelog/DiffChangelogIntegrationTest.groovy # liquibase-maven-plugin/src/main/java/org/liquibase/maven/plugins/LiquibaseDatabaseDiff.java # liquibase-maven-plugin/src/main/java/org/liquibase/maven/plugins/LiquibaseGenerateChangeLogMojo.java # liquibase-standard/src/main/java/liquibase/change/ReplaceIfExists.java # liquibase-standard/src/main/java/liquibase/command/core/DiffChangelogCommandStep.java # liquibase-standard/src/main/java/liquibase/command/core/GenerateChangelogCommandStep.java # liquibase-standard/src/main/java/liquibase/integration/commandline/CommandLineUtils.java
@filipelautert done! |
Internal documentation ticket: https://datical.atlassian.net/browse/PD-4098 |
Closes #4634
Impact
Description
This PR introduces two new options:
--run-on-change-types=createView,createProcedure
will setrunOnChange="true"
for eachchangeSet
which contains solelycreateView
andcreateProcedure
changes. For backwards compatibility, the default is an empty list.--replace-if-exists=createView,createProcedure
will setreplaceIfExists="true"
for eachcreateView
andcreateProcedure
change. For backwards compatibility, the default is an empty list.Things to be aware of
N/A
Things to worry about
N/A
Additional Context
N/A