Bug #78771
closedConnectionMigrator does not handle renamed columns
100%
Description
Hello Core-Team,
in our extension events2 I have renamed the column "events" to "event", but "Database analyzer" can not detect that change. So currently I have to rename that column on my own on DB directly.
SchemaDiff class of Doctrine DBAL compares the arrays of addedColumns against removedColumns. If some Options are the same the SchemaDiff class moves that difference to renamedColumns and DELETEs the entries from addedColumns and removedColumns.
In ConnectionManager you only collect the values of addedColumns (Method: getNewFieldUpdateSuggestions) and removedColumns (Method: getUnusedFieldUpdateSuggestions), but there is no check against renamedColumns.
In the meanwhile I have 12 tables incl. some TYPO3 tables like sys_file_metadata and pages which could not be migrated because of renamedColumns.
Stefan
Updated by Christian Kuhn about 8 years ago
Stefan, I think that's not possible. The schema analyzer compares definition (ext_tables) with current db state, but it does not compare a "previous" definition with definition "now". There is no other state.
Saying "hey, you want to have field 'event', it is not in db, but i found a similar field 'events' let's use that instead" is guess work that will immediately fail.
What you want / need is migration. This needs a concept anyway.
Updated by Christian Kuhn about 8 years ago
tend to close that issue. renaming / migration is not task of the db analyzer. Or do i misunderstand your issue?
Updated by Christian Kuhn about 8 years ago
Ok, slightly misunderstood this issue. The problem is that fields which are detected by doctrine as "rename" are NOT added later, so those fields are missing and can not be added by install tool schema analyzer. this is clearly a bug that needs to be fixed.
however, i think, we must NOT use the renaming functionality of doctrine, but switch those suggestions to add instead, or disable the rename integration.
Updated by Gerrit Code Review about 8 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50764
Updated by Gerrit Code Review almost 8 years ago
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51085
Updated by Gerrit Code Review almost 8 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51085
Updated by Gerrit Code Review almost 8 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51085
Updated by Gerrit Code Review almost 8 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51085
Updated by Gerrit Code Review almost 8 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51085
Updated by Morton Jonuschat almost 8 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset e3779b1f51d58550de201c057ca901e6b7d33ab2.
Updated by Robert Vock over 7 years ago
- Precedes Bug #81756: DatabaseSchemaComparator does not handle renamed columns added
Updated by Christian Kuhn about 6 years ago
- Related to Bug #86793: Renamed columns are not correctly detected by database schema diff added