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

Deprecate custom schema options #5476

Merged
merged 1 commit into from
Jul 3, 2022

Conversation

morozov
Copy link
Member

@morozov morozov commented Jul 3, 2022

Custom schema options effectively duplicate the functionality of platform options:

dbal/src/Schema/Column.php

Lines 432 to 447 in 541e9dd

public function toArray()
{
return array_merge([
'name' => $this->_name,
'type' => $this->_type,
'default' => $this->_default,
'notnull' => $this->_notnull,
'length' => $this->_length,
'precision' => $this->_precision,
'scale' => $this->_scale,
'fixed' => $this->_fixed,
'unsigned' => $this->_unsigned,
'autoincrement' => $this->_autoincrement,
'columnDefinition' => $this->_columnDefinition,
'comment' => $this->_comment,
], $this->_platformOptions, $this->_customSchemaOptions);

I didn't even know they exist until they were used in an issue reproducer (#5338 (comment)).

As of #4746, platform options are used for schema comparison:

$options = $column->getPlatformOptions();

But custom schema options aren't, so those who use them to define the schema will likely experience issues with schema comparison.

@morozov morozov force-pushed the deprecate-custom-schema-options branch from 0ef9f95 to 54eed9d Compare July 3, 2022 00:44
@morozov morozov added this to the 3.4.0 milestone Jul 3, 2022
@morozov morozov requested review from greg0ire and derrabus July 3, 2022 01:31
UPGRADE.md Outdated

Custom schema options have been deprecated since they effectively duplicate the functionality of platform options.

The following `Column` class properties and methods been deprecated:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
The following `Column` class properties and methods been deprecated:
The following `Column` class properties and methods have been deprecated:

@morozov morozov force-pushed the deprecate-custom-schema-options branch from 54eed9d to fcccc2d Compare July 3, 2022 15:23
@morozov morozov merged commit 3be3e53 into doctrine:3.4.x Jul 3, 2022
@morozov morozov deleted the deprecate-custom-schema-options branch July 3, 2022 17:11
@morozov morozov added the Columns label Jul 3, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 4, 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