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

Remove redundant condition from DB2 platform #5621

Merged
merged 1 commit into from
Aug 27, 2022

Conversation

morozov
Copy link
Member

@morozov morozov commented Aug 26, 2022

Effectively, it (poorly) duplicates the following one:

if (
$columnDiff->hasChanged('type') ||
$columnDiff->hasChanged('length') ||
$columnDiff->hasChanged('precision') ||
$columnDiff->hasChanged('scale') ||
$columnDiff->hasChanged('fixed')
) {

If the provided set of changed properties doesn't warrant a certain schema change, DB2Platform::getAlterColumnClausesSQL() will produce an empty array of SQL statements.

@morozov morozov marked this pull request as ready for review August 26, 2022 21:20
@@ -610,10 +610,6 @@ public function getAlterTableSQL(TableDiff $diff)
$columnDiff->column->getQuotedName($this),
$this->getColumnComment($columnDiff->column)
);

if (count($columnDiff->changedProperties) === 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.

The real reason for this change is to get rid of direct access to ColumnDiff::$changedProperties and enable further refactoring of the schema comparison API.

#5620 was implemented for the same purpose as well. More changes are to follow.

@morozov morozov merged commit 7d36cb2 into doctrine:3.5.x Aug 27, 2022
@morozov morozov deleted the db2-alter-table-cleanup branch August 27, 2022 18:08
@morozov morozov added this to the 3.5.0 milestone Sep 29, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 30, 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.

None yet

2 participants