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

Fix/3717 filter table on diesel migration --diff-schema #3725

Merged
merged 12 commits into from
Aug 15, 2023

Conversation

gmanninglive
Copy link
Contributor

@gmanninglive gmanninglive commented Aug 2, 2023

Fixes: #3717

I have made changes to allow diesel migration --diff-schema to accept filter args matching diesel print-schema

I came across a few issues while working on this:

  1. I can't think of how to move the filter attribute from PrintSchema to Config without a breaking change
  2. The documentation for table-names arg seems incorrect to me, It currently states (default only-tables if not empty). But I'm pretty sure it defaults to None currently

TODO:

  1. Update documentation where necessary

I'll add some more info to this PR description before requesting review

Copy link
Member

@weiznich weiznich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this. The implementation looks really good 👍 I have one minor question otherwise this is fine from my side.

diesel_cli/src/migrations/mod.rs Show resolved Hide resolved
@weiznich
Copy link
Member

weiznich commented Aug 3, 2023

I've rebased this branch to pull in the changes from #3729 to fix the broken tests.

.index(2)
.num_args(1..)
.action(clap::ArgAction::Append)
.help("Table names to filter (default only-tables if not empty)."),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weiznich would you like me to change this to:

Suggested change
.help("Table names to filter (default only-tables if not empty)."),
.help("Table names to filter"),

Because as far as I can see, filtering so far has only worked by specifying -o or -e
the change would also be made for print-schema below

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm in favor of this change (also for the print-schema) part.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay I've just made this change. I think this should be good to go now, as long as you're happy with it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries from taking some time. We all work on this in our free time, so it's fine to take as much time as needed. There is always real life, which is more important than this.

@gmanninglive
Copy link
Contributor Author

I've rebased this branch to pull in the changes from #3729 to fix the broken tests.

Thanks for rebasing this!, I've left a couple comments and will set ready for review. Thanks for approving already too 😄

@gmanninglive gmanninglive marked this pull request as ready for review August 7, 2023 22:41
Copy link
Member

@weiznich weiznich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

@weiznich weiznich added this pull request to the merge queue Aug 15, 2023
Merged via the queue into diesel-rs:master with commit a122e7b Aug 15, 2023
31 checks passed
weiznich added a commit to weiznich/diesel that referenced this pull request Aug 18, 2023
Fix/3717 filter table on `diesel migration --diff-schema`
@weiznich weiznich mentioned this pull request Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filter table not applied on diesel migration --diff-schema
2 participants