I downloaded and enabled the email download module and received the following error:

user warning: Incorrect table definition; there can be only one auto column and it must be defined as a key query: CREATE TABLE email_download_download ( `eid` INT unsigned NOT NULL DEFAULT 0, `did` INT unsigned auto_increment DEFAULT NULL, `updated_at` DATETIME NOT NULL, `count` INT unsigned NOT NULL, `file` VARCHAR(255) NOT NULL, PRIMARY KEY (eid, did) ) /*!40100 DEFAULT CHARACTER SET utf8 */ in D:\work\drupal_templates\includes\database.inc on line 550.

using Drupal 6.22

Comments

MattMoody’s picture

Version: 6.x-2.x-dev » 6.x-1.0

The same problem in 6.x-2.x-dev version
I downloaded and enabled the email download module and received the following error:

user warning: Incorrect table definition; there can be only one auto column and it must be defined as a key query: CREATE TABLE email_download_download ( `eid` INT unsigned NOT NULL DEFAULT 0, `did` INT unsigned auto_increment DEFAULT NULL, `updated_at` DATETIME NOT NULL, `count` INT unsigned NOT NULL, `file` VARCHAR(255) NOT NULL, PRIMARY KEY (eid, did) ) /*!40100 DEFAULT CHARACTER SET utf8 */ in D:\work\drupal_templates\includes\database.inc on line 550.

using Drupal 6.22

hadsie’s picture

Version: 6.x-1.0 » 6.x-2.x-dev
Assigned: MattMoody » Unassigned
Category: bug » support
Priority: Major » Normal

Can you try to completely uninstall the module and make sure that the email_download_download table doesn't exist in the database. Then reinstall the module.

Also, what version of MySQL are you using?

MattMoody’s picture

email_download_download table doesn't exist even after install. MySQL 5.1.54-community

hadsie’s picture

Status: Active » Fixed

Hey Matt,

I've created a 2.x stable release now with some minor changes to the database. Can you make sure your existing email_download code is completely removed and uninstalled and then try the 6.x-2.1 release?

The thing that's weird here, is that in the error message it prints out the table that's having an issue, and there's clearly only one autoincrement field. Regardless, I don't think there was any benefit to using a composite primary key for that table so I removed it, that should resolve the issue here.

MattMoody’s picture

Status: Fixed » Closed (fixed)

Thanks