After running update.php when trying to upgrade from 6.x-1.1 to 6.x-2.x-dev (since I would like the lifetime quantity limit feature) I received the following message:

user warning: Duplicate column name 'lifetime' query: ALTER TABLE uc_restrict_qty_products ADD `lifetime` TINYINT unsigned NOT NULL DEFAULT 1 in [base-dir]/public_html/sandbox/includes/database.mysql-common.inc on line 298.

The following queries were executed
uc_restrict_qty module
Update #6200
No queries
Update #6201
Failed: ALTER TABLE {uc_restrict_qty_products} ADD `lifetime` TINYINT unsigned NOT NULL DEFAULT 1

Comments

CinemaSaville’s picture

luketsimmons’s picture

Status: Active » Needs review

Hi Shaun Dychko,

I was checking over issues before updating from 1.1 to 2.x-dev and spotted this issue. When you updated did you do straight from 1.1 to latest 2.x and didn't have the DB table in place already from a previous update to 2.x?

I'm asking because the schema for the table includes the "lifetime" column, and it looks like you updated straight to 6201, it would have added the column in 6200 then tried again in the second update.

The following may work as a solution for anyone having updated to get the DB table and then trying to update again (although no need).

function uc_restrict_qty_update_6201() {
  $ret = array();
  if (!db_column_exists('uc_restrict_qty_products', 'lifetime')) {
    db_add_field($ret, 'uc_restrict_qty_products', 'lifetime', array('type' => 'int', 'size' => 'tiny', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 1));
  }
  return $ret;
}

The bottom line is the schema should have installed OK (check out your DB), the error is just it trying again, but no harm should have been done.

Hopefully that helps,
luke

RaulMuroc’s picture

Issue summary: View changes
Status: Needs review » Closed (fixed)

Closing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).