I'm attempting a long-overdue upgrade from 7.x-3.x to 7.x-4.x, and got hung up on webform_update_7419 with this error:
Cannot add index data to table webform_submitted_data: index already exists.
So I've added a db_index_exists() check to that update hook so it won't halt when this happens.
| Comment | File | Size | Author |
|---|---|---|---|
| upgrade_3_to_4_index_fix.patch | 483 bytes | chellman |
Comments
Comment #1
danchadwick commentedThe better question would be why did your webform have an index on that column? Webform didn't put it there (to my knowledge). Perhaps you added it yourself? Or some other module adjusted webform's tables?
I don't think it's appropriate to check every database schema operation to see if someone has already done it.
Now if you can figure out that webform actually created the index twice, that's different!
Comment #2
danchadwick commentedOooh. Another thought. Did PHP timeout on building the index and you repeated the update? If so, then it might be possible for the table to have the index but the schema number in the system table to not have been updated. In that case, your patch would be a good idea.
Comment #4
danchadwick commentedBased on #2 and comparing it to other hook_update's that add an index, I think this is a good patch. Thank you.
Committed to 7.x-4.x
Comment #5
ecvandenberg commentedJust to get things clear to me...
I got the same error during performing database updates after update from Webform 7.x-3.23 to Webform 7.x-4.5. I certainly did not put that index there myself. And I don't have any Webform related projects installed. Perhaps Content Access 7.x-1.2-beta2 does something? If you need a full list of installed projects just let me know.
Can I just ignore the error and continue to work with the updated Webform module?
For now I restored my backup.
Comment #6
danchadwick commentedRe #5: This patch was committed to 7.x-4.x after 7.x-4.4 was released. So you can:
Comment #7
chellman commentedI also thought it was weird that this happened - it was on a development copy of the site in question, and when I ran the db update on the live version, it didn't get hung up. I didn't notice any timeouts or other weirdness, just the update failing. But anyway, I'm glad this seems to be helpful even if the problem is rare.