Bug #50450
Drop keys before fields in install tool
Status: | Resolved | Start date: | 2013-07-26 | |
---|---|---|---|---|
Priority: | Should have | Due date: | ||
Assigned To: | - | % Done: | 100% |
|
Category: | Install Tool | Spent time: | - | |
Target version: | 6.2.0 | |||
TYPO3 Version: | 6.2 | Is Regression: | ||
PHP Version: | Sprint Focus: | |||
Complexity: | easy |
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
Related issues
Associated revisions
[BUGFIX] Correct order of key / field deletion
Prevent an SQL error when deleting a key and the field belonging
to the key in the install tool at the same time.
Therefore the order of deleting keys and fields is changed from
field first and key second to key first and field second.
Resolves: #50450
Releases: master, 6.2
Change-Id: I30aff6ea6c2bf01dec6197eec8fd3aa7306cfcbb
Reviewed-on: http://review.typo3.org/22581
Reviewed-by: Helmut Hummel <helmut.hummel@typo3.org>
Tested-by: Helmut Hummel <helmut.hummel@typo3.org>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
[BUGFIX] Correct order of key / field deletion
Prevent an SQL error when deleting a key and the field belonging
to the key in the install tool at the same time.
Therefore the order of deleting keys and fields is changed from
field first and key second to key first and field second.
Resolves: #50450
Releases: master, 6.2
Change-Id: I30aff6ea6c2bf01dec6197eec8fd3aa7306cfcbb
Reviewed-on: http://review.typo3.org/34101
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
History
#1 Updated by Gerrit Code Review about 2 years ago
- Status changed from New to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/22581
#2 Updated by Christian Kuhn almost 2 years ago
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 ...
#3 Updated by Alexander Stehlik almost 2 years ago
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.
#4 Updated by Gerrit Code Review over 1 year 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/22581
#5 Updated by Gerrit Code Review over 1 year 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/22581
#6 Updated by Gerrit Code Review about 1 year 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/22581
#7 Updated by Gerrit Code Review 9 months ago
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
#8 Updated by Gerrit Code Review 9 months ago
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
#9 Updated by Gerrit Code Review 9 months ago
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
#10 Updated by Gerrit Code Review 9 months ago
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
#11 Updated by Gerrit Code Review 9 months ago
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
#12 Updated by Alexander Stehlik 9 months ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 1e2fbf9487db73fbcc9510dddee30909e65f13fc.