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

[MM-62662] add ability to compare tables with matching names only #8

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

isacikgoz
Copy link
Member

Summary

For convenience we add a new flag to compare only matching table names.

Ticket Link

https://mattermost.atlassian.net/browse/MM-62662

@isacikgoz isacikgoz added the 2: Dev Review Requires review by a core committer label Jan 30, 2025
@isacikgoz isacikgoz requested a review from agnivade January 30, 2025 07:05
@@ -45,6 +51,11 @@ func Compare(srcDSN, dstDSN string, opts CompareOptions) ([]string, error) {
delete(srcTables, k)
}
}
for e := range incl {
if !strings.Contains(k, strings.ToLower(e)) {
Copy link
Member

Choose a reason for hiding this comment

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

From the flag documentation, it looked like we should be doing an exact match? In that case, we could probably build up a map and check for this faster, rather than having 2 loops. But, not a blocker.

Copy link
Member Author

Choose a reason for hiding this comment

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

I slightly changed the logic, for include scenario it should be an exact match. PTAL @agnivade

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2: Dev Review Requires review by a core committer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants