Running D7.12 on PostgreSQL 9.1.

Steps to reproduce:
1) install commerce and basic coupon
2) don't do anything else (don't create coupons etc), just deactivate the basic coupon module
3) uninstall the basic coupon module
4) activate the basic coupon module again in admin/modules

This error is displayed:

PDOException: SQLSTATE[42P07]: Duplicate table: 7 ERROR: relation "field_revision_commerce_coupon_code_commerce_coupon_code_format" already exists: CREATE INDEX "field_revision_commerce_coupon_code_commerce_coupon_code_format_idx" ON {field_revision_commerce_coupon_code} ("commerce_coupon_code_format"); Array ( ) in db_create_table() (line 2688 of /srv/http/d7.rovin.be/includes/database/database.inc).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bart.hanssens’s picture

Could be that Postgresql limits the length of a name to 64-1 bytes (http://www.postgresql.org/docs/9.1/interactive/sql-syntax-lexical.html#S...)

bart.hanssens’s picture

Issue tags: +PostgreSQL
pcambra’s picture

Title: Duplicate table error when reinstalling » Fix uninstall issues

Agreed, we have uninstall/reinstall issues related mostly with fields.

pcambra’s picture

Status: Active » Fixed
Issue tags: -PostgreSQL

Just pushed a big change to fix the uninstall issues.

Outlining the change, what I've just finished was:

  • Fix the coupon type entity, we had a type_id field for no reason that was also a primary key.
  • Make the deletion of coupon type entities a little more standard with the rest of the module.
  • Fix the coupon_reference field, which was totally faked for some reason and now is working properly with no hacks.
  • Added the removal of the coupon_reference_field in the uninstall process of the commerce_coupon_module.
  • Change the pct and fixed modules accordingly with all these changes.

Hope now we don't have mode uninstall issues.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

lachezar.valchev’s picture

Hi,

I just want to add a patch that was created based on this thread. Hope it can help anyone struggling with that issue.