Bug #50450
closed
Drop keys before fields in install tool
Added by Alexander Stehlik about 11 years ago.
Updated almost 7 years ago.
Description
When a key and the field that is referenced in the key will be removed at the same time in the install tool a database error will occur:
Error: Can't DROP '<key_name>'; check that column/key exists
This is because the install tool will first remove the field and then tries to remove the key which obviously will not work because the referenced field was already deleted.
The solution would be to drop the key before the field.
Steps to reproduce:
- install phpunit extension
- update database in install tool
- uninstall phpunit extension
- in the install tool rename a phpunit dummy field, e.g.
ALTER TABLE be_groups CHANGE tx_phpunit_is_dummy_record zzz_deleted_tx_phpunit_is_dummy_record tinyint(1) unsigned NOT NULL default '0';
- now select the key and the field to be really dropped
ALTER TABLE be_groups DROP zzz_deleted_tx_phpunit_is_dummy_record;
ALTER TABLE be_groups DROP KEY phpunit_dummy;
- You will see an error message
Error: Can't DROP 'phpunit_dummy'; check that column/key exists
- Status changed from New to Under Review
yeah. Problem: the database schema migrator class is hell, it should be rewritten anyway. atm i do not feel comfortable hacking something like a solution for the concrete problem into the current code ...
Is it realistic that a rewrite of the SqlSchemaMigrationService is done for 6.2?
If not, a bugfix is better than nothing. And it is not really that "hacky" or complicated. Just changing the order of the database operations.
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/22581
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/22581
Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/22581
Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/22581
Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/34101
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Closed
Also available in: Atom
PDF