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

Implement platform-aware schema comparison #1229

Merged
merged 1 commit into from
Jan 13, 2022

Conversation

greg0ire
Copy link
Member

This should fix many bugs because it eliminates a lot of false positive
and false negative diffs.

Closes #1227

->method('getMigrateFromSql')
->with($toSchema, $this->platform)
->willReturn(['UPDATE table SET value = 1']);
}
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 tried to find a way to abide by "don't mock what you don't own" and reduce the big amount of mocking in this test, and gave up… I think it should be reworked, but I'm not sure how.

@greg0ire greg0ire force-pushed the platform-aware-comparison branch 3 times, most recently from 3edd76c to 9e44edc Compare January 12, 2022 21:25
This should fix many bugs because it eliminates a lot of false positive
and false negative diffs.

$upSql = isset($comparator) ?
$comparator->compareSchemas($fromSchema, $toSchema)->toSql($this->platform) :
$fromSchema->getMigrateToSql($toSchema, $this->platform);
Copy link
Member Author

Choose a reason for hiding this comment

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

At first, I tried inlining the contents of this method to avoid the deprecation, but then I could no longer mock anything.

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.

3 participants