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

Add runtime deprecations for default string column length #5377

Merged

Conversation

morozov
Copy link
Member

@morozov morozov commented May 5, 2022

No description provided.

'name' => $name,
'version' => $column->hasPlatformOption('version') ? $column->getPlatformOption('version') : false,
'comment' => $this->getColumnComment($column),
]);

if ($columnData['type'] instanceof Types\StringType && $columnData['length'] === null) {
$columnData['length'] = $this->getVarcharDefaultLength();
Copy link
Member Author

Choose a reason for hiding this comment

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

This is already implemented in getVarcharTypeDeclarationSQL():

if (! isset($column['length'])) {
$column['length'] = $this->getVarcharDefaultLength();
}

If this block is left as is, then it will be impossible to detect whether the column length was specified explicitly or the default value is used.

@morozov morozov force-pushed the default-string-length-runtime-deprecation branch from 05a2211 to 185bdd3 Compare May 5, 2022 03:49
@morozov morozov marked this pull request as ready for review May 5, 2022 04:44
@morozov morozov requested review from greg0ire and derrabus May 5, 2022 04:45
@morozov morozov merged commit b4e2020 into doctrine:3.4.x May 5, 2022
@morozov morozov deleted the default-string-length-runtime-deprecation branch May 5, 2022 13:14
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 6, 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.

3 participants