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

Allow to override --nocheck-unique-key-changes and --alter-foreign-keys-method=auto #29

Closed
bellatoris opened this issue Apr 9, 2019 · 4 comments
Milestone

Comments

@bellatoris
Copy link

bellatoris commented Apr 9, 2019

I need to set check-unique-key-changes and specify alter-foreign-keys-method as rebuild_constraints.

https://github.com/adangel/liquibase-percona/blob/c8f1089feb0a06430df938b3fc5c02c67ab91fc2/src/main/java/liquibase/ext/percona/PTOnlineSchemaChangeStatement.java#L122-L123

If there are option to disable --nocheck-unique-key-changes and --alter-foreign-keys-method=auto, it is really helpful.

@adangel
Copy link
Collaborator

adangel commented Apr 9, 2019

This is currently not possible, as these options are always added:

https://github.com/adangel/liquibase-percona/blob/c8f1089feb0a06430df938b3fc5c02c67ab91fc2/src/main/java/liquibase/ext/percona/PTOnlineSchemaChangeStatement.java#L122-L123

But we could add some kind of new option (boolean), so that these are not added by default. You need to specify your own options via liquibase.percona.options.

Would you need this configuration per change? (the described above would be a global option)

@bellatoris
Copy link
Author

You need to specify your own options via liquibase.percona.options.

It does not help this case. Because the default options are always added later than my own options. So it override my options always.

@bellatoris
Copy link
Author

Would you need this configuration per change? (the described above would be a global option)

Of course it would be better if it is possible. Now, however, I just need global option.

@adangel adangel added this to the 1.6.0 milestone Apr 14, 2019
@adangel adangel changed the title How can I disable --nocheck-unique-key-changes and --alter-foreign-keys-method=auto Allow to override --nocheck-unique-key-changes and --alter-foreign-keys-method=auto Apr 14, 2019
@adangel
Copy link
Collaborator

adangel commented Apr 14, 2019

Hi @bellatoris ,
I've fixed this. Would you mind to test it?
You can now set the property liquibase.percona.options. It defaults to be --alter-foreign-keys-method=auto --nocheck-unique-key-change, but you can change it to your needs.

Just download the 1.6.0-SNAPSHOT jar from here:
https://oss.sonatype.org/content/repositories/snapshots/com/github/adangel/liquibase/ext/liquibase-percona/1.6.0-SNAPSHOT/liquibase-percona-1.6.0-20190414.195807-2.jar

Or simply use the snapshot dependency, see https://github.com/adangel/liquibase-percona#using-snapshots

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