You are here

function uc_product_update_6000 in Ubercart 6.2

File

uc_product/uc_product.install, line 238
Install, update and uninstall functions for the uc_product module.

Code

function uc_product_update_6000() {
  $ret = array();
  db_drop_primary_key($ret, 'uc_product_features');
  db_drop_index($ret, 'uc_product_features', 'nid');
  db_change_field($ret, 'uc_product_features', 'pfid', 'pfid', array(
    'type' => 'serial',
    'unsigned' => TRUE,
    'not null' => TRUE,
  ), array(
    'primary key' => array(
      'pfid',
    ),
  ));
  db_change_field($ret, 'uc_product_features', 'nid', 'nid', array(
    'type' => 'int',
    'unsigned' => TRUE,
    'not null' => TRUE,
    'default' => 0,
  ), array(
    'indexes' => array(
      'nid' => array(
        'nid',
      ),
    ),
  ));
  db_drop_primary_key($ret, 'uc_products');
  db_change_field($ret, 'uc_products', 'vid', 'vid', array(
    'type' => 'int',
    'unsigned' => TRUE,
    'not null' => TRUE,
    'default' => 0,
  ), array(
    'primary key' => array(
      'vid',
    ),
  ));
  db_change_field($ret, 'uc_products', 'nid', 'nid', array(
    'type' => 'int',
    'unsigned' => TRUE,
    'not null' => TRUE,
    'default' => 0,
  ));
  db_change_field($ret, 'uc_products', 'list_price', 'list_price', array(
    'type' => 'numeric',
    'precision' => 10,
    'scale' => 2,
    'unsigned' => TRUE,
    'not null' => TRUE,
    'default' => 0,
  ));
  db_change_field($ret, 'uc_products', 'cost', 'cost', array(
    'type' => 'numeric',
    'precision' => 10,
    'scale' => 2,
    'unsigned' => TRUE,
    'not null' => TRUE,
    'default' => 0,
  ));
  db_change_field($ret, 'uc_products', 'sell_price', 'sell_price', array(
    'type' => 'numeric',
    'precision' => 10,
    'scale' => 2,
    'unsigned' => TRUE,
    'not null' => TRUE,
    'default' => 0,
  ));
  db_change_field($ret, 'uc_products', 'weight', 'weight', array(
    'type' => 'float',
    'unsigned' => TRUE,
    'not null' => TRUE,
    'default' => 0,
  ));
  db_change_field($ret, 'uc_products', 'unique_hash', 'unique_hash', array(
    'type' => 'varchar',
    'length' => 32,
    'not null' => TRUE,
    'default' => 'd41d8cd98f00b204e9800998ecf8427e',
  ));
  db_change_field($ret, 'uc_products', 'shippable', 'shippable', array(
    'type' => 'int',
    'unsigned' => TRUE,
    'size' => 'tiny',
    'not null' => TRUE,
    'default' => 1,
  ));
  return $ret;
}