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
Interplay between foreign keys and the include-objects/exclude-objects flags #5746
Comments
Hi @Dzeri96, It sounds better to me to ignore the foreign key constraint (or any other change type) than recursively looking for the objects to either include or exclude. Do you know the place where to start looking at? Thanks, |
@MalloD12 I haven't looked at the code yet, but it should be pretty simple to terminate a recursive branch if the next child is not in the 'include' list. I think we can have the best of both worlds, but that's just theory. |
Hey @Dzeri96, If I didn't see it wrong our guy should be Thanks, |
@MalloD12 I just assumed that recursion is already part of the process, as I get a stack overflow if I don't increase the stack size when running liquibase on our company's DB. If this is a welcome feature, which seems like it is, I'll try to make a PR. Can't really promise when but I'll definitely keep it in my backlog. |
Sure, feel free to submit that PR when you have a chance. We will be happy to review it and test it. Thanks! |
Search first
Description
When running the
generate-changelog
command with the--include-objects
/--exclude-objects
flags, foreign key constraints referencing non-included objects are still present in the created changelog.This is not a huge problem when generating SQL scripts with separate
ALTER TABLE
statements, but otherwise I think it might prevent the application of changelogs entirely.Steps To Reproduce
Create two tables in the DB, with table A having a foreign key constraint referencing table B. Run
liquibase generate-changelog --include-objects="A"
.Expected/Desired Behavior
I see two ways to solve this:
Liquibase Version
4.26.0
Database Vendor & Version
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0
Liquibase Integration
CLI
Liquibase Extensions
No response
OS and/or Infrastructure Type/Provider
Windows Server 2012 (I know...)
Additional Context
No response
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: