After upgrading Drupal commerce kickstart to 7.38 there are database updates to be completed. Once deal with Commerce_discount and fails to update every time with the following message:
DatabaseSchemaObjectExistsException: Table field_data_discount_usage_per_person already exists. in DatabaseSchema->createTable() (line 660 of [localpath]/public/includes/database/schema.inc).
These two updates are pending:
7109 - Check for wrong discount values, before form validation was introduced. @see https:www.drupal.orgnode2468159#comment-10100064
7110 - Enable and update usage and date sub-modules into discount core.
When repeating the process the update 7110 seems to cause the problem:
Update 7109 finished. Please check all your percentage based discount settings for correct values after this update!Number of percentage values [ok]
in table "field_data_commerce_percentage" who were updated as a result: 0
Performed update: commerce_discount_update_7109
Table field_data_discount_usage_per_person already exists. [error]
Performed update: commerce_discount_update_7110
So, potential problems are:
- table exists and has data so it can't be modified
- table exists with corrupted data update fails
- table exists but update tries to create it again.
How can we contribute to fix this. Given the various recent security updates and subsequent commerce-kickstart updates and failures make this more difficult than I imagined it.
Comments
Comment #2
el_reverend CreditAttribution: el_reverend commentedI have tried running the update on revert of a live site again, this time with deleting the offending table (it had no rows in it): but the same problem occurs:
Comment #3
troseman CreditAttribution: troseman commentedsame issue here. also tried dropping table before update and same result.
Comment #4
giuseppe.minnella CreditAttribution: giuseppe.minnella commentedSame issue here too.
Btw, one time easy workaround (not sure about side effects):
In
/profiles/commerce_kickstart/modules/contrib/commerce_discount/commerce_discount.install:188
set
$fields = field_read_fields(array(), array('include_inactive' => TRUE));
to
$fields = field_read_fields(array(), array('include_inactive' => FALSE));
run the update then bring it back to TRUE.
Comment #5
troseman CreditAttribution: troseman commentedusing Schema module saw that the field_data_discount_usage_* tables are unknown.
So deleted them:
drop table field_data_discount_usage_limit;
drop table field_data_discount_usage_per_person;
drop table field_revision_discount_usage_limit;
drop table field_revision_discount_usage_per_person;
re-ran drush dl commerce_kickstart (not sure if needed), then drush updatedb -y
succeeded with no errors.
Comment #6
candelas CreditAttribution: candelas as a volunteer commentedHello
I believe that this should be in the discount module. I change it and if you don't think is it correct, change it again :)
Comment #7
candelas CreditAttribution: candelas as a volunteer commented