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

Source column defaults from its own table #5326

Merged
merged 1 commit into from
Mar 20, 2022

Conversation

morozov
Copy link
Member

@morozov morozov commented Mar 19, 2022

Change summary:

  1. Instead of sourcing column defaults from the from/online table, source them from its own table.
  2. Add some more assertions that test the inverse diff. Those assertions would fail without the fix so I believe they cover the originally reported scenario.

Fixes #5322.

@@ -202,18 +202,7 @@ public function testDoesNotPropagateDefaultValuesForUnsupportedColumnTypes(): vo

$diff = $this->schemaManager->createComparator()
->diffTable($table, $onlineTable);
self::assertNotFalse($diff);
Copy link
Member Author

Choose a reason for hiding this comment

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

The expectation that there should be a diff is invalid. It's a bug that is mitigated down the line:

// Don't propagate default value changes for unsupported column types.
if (
$columnDiff->hasChanged('default') &&
count($columnDiff->changedProperties) === 1 &&
($columnArray['type'] instanceof TextType || $columnArray['type'] instanceof BlobType)
) {
continue;
}

We may try removing this condition as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

Funny thing is that this is one of the conditions that cause #4747.

@morozov morozov marked this pull request as ready for review March 19, 2022 17:52
@morozov morozov added this to the 3.3.4 milestone Mar 19, 2022
@morozov morozov merged commit 6f33b11 into doctrine:3.3.x Mar 20, 2022
@morozov morozov deleted the issues/5322 branch March 20, 2022 15:50
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Charset or Collation are ignored during migration
2 participants