-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 explicit renameColumn method #6280
Conversation
3800200
to
86baabb
Compare
return ''; | ||
} | ||
|
||
if (! empty($column['version'])) { | ||
if ((string) $column['type'] !== 'DateTime') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might not be covered by tests, when I messed around and removed the if
there was an error that Dbal/Types/DateTimeType cannot be converted to string, which makes sense because 'type' in column is a DbalType
which doesn't have a __toString()
, might need to be backported to 3.8 as well
I also think in 4.x we should abolish column converted to arrays in all the AbstractPlatform methods and use the Column
class to get the correct type hints and static analysis (for a different PR)
Since we've reverted the feature, this is technically not a merge anymore. I've adjusted the PR title accordingly. Can you please rebase your changes onto 4.0.x? Currently the PR contains irrelevant changes that 4.0.x contains already. |
cde8651
to
5678b6d
Compare
Hmmm, 4.0.x was released already? I though you would wait for this PR on both 3.9 and 4.0 Then this PR which includes breaking changes which were meant to be deprecated in 3.x cannot be released anymore in 4.x from my understanding and only in 5.x and the PR #6080 without the breaking changes need to be redone for 4.x? This is way more work than I can put into this ATM |
Sorry we didn't warn you about it, we had a lot on our plate and this apparently fell through the cracks.
Yes, exactly. There is very little difference between 5.0.x and 4.1.x right now, so the most convenient time to do it is now. I think what you can do is:
|
Should the revert be for 3.9 or 4.1 ? If it's for 4.x we still have the same problem with tons of conflict with v4 so it's easier to start from this PR and simply revert the breaking changes using the old PR I could open 3 PRs, one against 3.9 again without breaking change which is basically the old reverted PR, 4.1 which is this port still but without breaking changes and 5.0.x which is this PR |
Sorry, I'm kinda busy right now, but I haven forgotten this PR. Promise!
|
There hasn't been any activity on this pull request in the past 90 days, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days. |
And that's my fault, dear bot. Let's keep it open. |
Let's ship this. Apologies for this really way too long delay. I decided that we will ship this feature with 4.1.0 only, without a backport to 3.x. Because we're very low on maintainers on this repository, I'd like to keep DBAL 3 super-stable which means we're not shipping new features on that branch. I hope this is okay for you. |
* 4.1.x: Add explicit renameColumn method (doctrine#6280) Make AbstractSchemaManager covariant to its template argument
No problem with me, I'm also very busy and didn't have time to review this to make a PR for v4 and v5, though I do believe there were a few minor breaking changes in this PR (I think only in TableDiff, 2 methods removed) which might need a compatibility layer for v4 which is what I didn't have time to check but I already made it in the previous PR for v3 so it might just be a question of taking those 2 methods from the old PR and remove them in v5 |
Here I took the code from the old PR and adapted it for v4 /**
* @deprecated Use {@see getChangedColumns()} instead.
*
* @return list<ColumnDiff>
*/
public function getModifiedColumns(): array
{
Deprecation::triggerIfCalledFromOutside(
'doctrine/dbal',
'https://github.com/doctrine/dbal/pull/6280',
'%s is deprecated, use `getChangedColumns()` instead.',
__METHOD__,
);
return array_values(array_filter($this->getChangedColumns(), static function (ColumnDiff $diff) {
return $diff->countChangedProperties() > ($diff->hasNameChanged() ? 1 : 0);
}));
}
/**
* @deprecated Use {@see getChangedColumns()} instead.
*
* @return array<string,Column>
*/
public function getRenamedColumns(): array
{
Deprecation::triggerIfCalledFromOutside(
'doctrine/dbal',
'https://github.com/doctrine/dbal/pull/6280',
'%s is deprecated, you should use `getChangedColumns()` instead.',
__METHOD__,
);
$renamed = [];
foreach ($this->getChangedColumns() as $diff) {
if (! $diff->hasNameChanged()) {
continue;
}
$oldColumnName = $diff->getOldColumn()->getName();
$renamed[$oldColumnName] = $diff->getNewColumn();
}
return $renamed;
} |
* 4.1.x: Fix tests (doctrine#6481) Add explicit renameColumn method (doctrine#6280) Make AbstractSchemaManager covariant to its template argument
Right, we're missing the deprecation layer now. Let me check if I can add it. |
See #6482 |
With doctrine#6280 quite some changes has been applied, which removed the code path to create alter sql statement if length of a field has changed. This change adds a general test for this case and reimplement the accidently removed code from the `PostgreSQLPlatform`.
With doctrine#6280 quite some changes has been applied, which removed the code path to create alter sql statement if length of a field has changed. This change adds a general test for this case and reimplement the accidently removed code from the `PostgreSQLPlatform`.
With doctrine#6280 quite some changes has been applied, which removed the code path to create alter sql statement if length of a field has changed. This change adds a general test for this case and reimplement the accidently removed code from the `PostgreSQLPlatform`.
With doctrine#6280 quite some changes has been applied, which removed the code path to create alter sql statement if length of a field has changed. This change adds a general test for this case and reimplement the accidently removed code from the `PostgreSQLPlatform`.
With doctrine#6280 quite some changes has been applied, which removed the code path to create alter sql statement if length of a field has changed. This change adds a general test for this case and reimplement the accidently removed code from the `PostgreSQLPlatform`.
With doctrine#6280 quite some changes has been applied, which removed the code path to create alter sql statement if length of a field has changed. This change adds a general test for this case and reimplement the accidently removed code from the `PostgreSQLPlatform`.
| Q | A |------------- | ----------- | Type | feature | Fixed issues | N/A #### Summary #6280 removed columns without explicitly deprecating them. This PR adds the missing deprecation layer. Co-authored-by: Tofandel <[email protected]>
The Doctrine Team recently released minor version release `4.1.0` including a couple of bugfixes, internal changes and also new features [1]. The aforementioned internal changes introduces breaking stuff within internal implementation, for example the TYPO3 Database Analyzer stack enforcing adoption [2][3][4]. Sadly, it's not possible to provide backwards compatible code and thus minimum version raise is "absolutly" required. Doctrine DBAL 4.1.0 also includes new platform implementation for some database platforms and this change adds them as extend replacements to ensure working state with TYPO3 DB Analyzer. Note that previous TYPO3 v13.x composer instances needs to limit doctrine/dbal to 4.0.x on their own to avoid breaking behaviour. Used command(s): \ composer require --no-update --no-install \ -d typo3/sysext/redirects \ "doctrine/dbal":"^4.1" \ && composer require --no-update --no-install \ -d typo3/sysext/core \ "doctrine/dbal":"^4.1" \ && composer require --no-update --no-install \ -d typo3/sysext/install \ "doctrine/dbal":"^4.1" \ && composer require "doctrine/dbal":"^4.1" [1] https://github.com/doctrine/dbal/releases/tag/4.1.0 [2] doctrine/dbal#6280 [3] doctrine/dbal#6482 [4] doctrine/dbal#6490 Resolves: #104628 Releases: main Change-Id: I53c86feed17abc6a90625e27fb135f606a57fc9f Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/85620 Reviewed-by: Christian Kuhn <[email protected]> Reviewed-by: Andreas Kienast <[email protected]> Tested-by: core-ci <[email protected]> Tested-by: Christian Kuhn <[email protected]> Tested-by: Andreas Kienast <[email protected]> Tested-by: Stefan Bürk <[email protected]> Reviewed-by: Stefan Bürk <[email protected]>
The Doctrine Team recently released minor version release `4.1.0` including a couple of bugfixes, internal changes and also new features [1]. The aforementioned internal changes introduces breaking stuff within internal implementation, for example the TYPO3 Database Analyzer stack enforcing adoption [2][3][4]. Sadly, it's not possible to provide backwards compatible code and thus minimum version raise is "absolutly" required. Doctrine DBAL 4.1.0 also includes new platform implementation for some database platforms and this change adds them as extend replacements to ensure working state with TYPO3 DB Analyzer. Note that previous TYPO3 v13.x composer instances needs to limit doctrine/dbal to 4.0.x on their own to avoid breaking behaviour. Used command(s): \ composer require --no-update --no-install \ -d typo3/sysext/redirects \ "doctrine/dbal":"^4.1" \ && composer require --no-update --no-install \ -d typo3/sysext/core \ "doctrine/dbal":"^4.1" \ && composer require --no-update --no-install \ -d typo3/sysext/install \ "doctrine/dbal":"^4.1" \ && composer require "doctrine/dbal":"^4.1" [1] https://github.com/doctrine/dbal/releases/tag/4.1.0 [2] doctrine/dbal#6280 [3] doctrine/dbal#6482 [4] doctrine/dbal#6490 Resolves: #104628 Releases: main Change-Id: I53c86feed17abc6a90625e27fb135f606a57fc9f Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/85620 Reviewed-by: Christian Kuhn <[email protected]> Reviewed-by: Andreas Kienast <[email protected]> Tested-by: core-ci <[email protected]> Tested-by: Christian Kuhn <[email protected]> Tested-by: Andreas Kienast <[email protected]> Tested-by: Stefan Bürk <[email protected]> Reviewed-by: Stefan Bürk <[email protected]>
The Doctrine Team recently released minor version release `4.1.0` including a couple of bugfixes, internal changes and also new features [1]. The aforementioned internal changes introduces breaking stuff within internal implementation, for example the TYPO3 Database Analyzer stack enforcing adoption [2][3][4]. Sadly, it's not possible to provide backwards compatible code and thus minimum version raise is "absolutly" required. Doctrine DBAL 4.1.0 also includes new platform implementation for some database platforms and this change adds them as extend replacements to ensure working state with TYPO3 DB Analyzer. Note that previous TYPO3 v13.x composer instances needs to limit doctrine/dbal to 4.0.x on their own to avoid breaking behaviour. Used command(s): \ composer require --no-update --no-install \ -d typo3/sysext/redirects \ "doctrine/dbal":"^4.1" \ && composer require --no-update --no-install \ -d typo3/sysext/core \ "doctrine/dbal":"^4.1" \ && composer require --no-update --no-install \ -d typo3/sysext/install \ "doctrine/dbal":"^4.1" \ && composer require "doctrine/dbal":"^4.1" [1] https://github.com/doctrine/dbal/releases/tag/4.1.0 [2] doctrine/dbal#6280 [3] doctrine/dbal#6482 [4] doctrine/dbal#6490 Resolves: #104628 Releases: main Change-Id: I53c86feed17abc6a90625e27fb135f606a57fc9f Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/85620 Reviewed-by: Christian Kuhn <[email protected]> Reviewed-by: Andreas Kienast <[email protected]> Tested-by: core-ci <[email protected]> Tested-by: Christian Kuhn <[email protected]> Tested-by: Andreas Kienast <[email protected]> Tested-by: Stefan Bürk <[email protected]> Reviewed-by: Stefan Bürk <[email protected]>
The Doctrine Team recently released minor version release `4.1.0` including a couple of bugfixes, internal changes and also new features [1]. The aforementioned internal changes introduces breaking stuff within internal implementation, for example the TYPO3 Database Analyzer stack enforcing adoption [2][3][4]. Sadly, it's not possible to provide backwards compatible code and thus minimum version raise is "absolutly" required. Doctrine DBAL 4.1.0 also includes new platform implementation for some database platforms and this change adds them as extend replacements to ensure working state with TYPO3 DB Analyzer. Note that previous TYPO3 v13.x composer instances needs to limit doctrine/dbal to 4.0.x on their own to avoid breaking behaviour. Used command(s): \ composer require --no-update --no-install \ -d typo3/sysext/redirects \ "doctrine/dbal":"^4.1" \ && composer require --no-update --no-install \ -d typo3/sysext/core \ "doctrine/dbal":"^4.1" \ && composer require --no-update --no-install \ -d typo3/sysext/install \ "doctrine/dbal":"^4.1" \ && composer require "doctrine/dbal":"^4.1" [1] https://github.com/doctrine/dbal/releases/tag/4.1.0 [2] doctrine/dbal#6280 [3] doctrine/dbal#6482 [4] doctrine/dbal#6490 Resolves: #104628 Releases: main Change-Id: I53c86feed17abc6a90625e27fb135f606a57fc9f Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/85620 Reviewed-by: Christian Kuhn <[email protected]> Reviewed-by: Andreas Kienast <[email protected]> Tested-by: core-ci <[email protected]> Tested-by: Christian Kuhn <[email protected]> Tested-by: Andreas Kienast <[email protected]> Tested-by: Stefan Bürk <[email protected]> Reviewed-by: Stefan Bürk <[email protected]>
Merges the changes of #6080 into 4.0.x