You are here

function uc_varprice_update_6001 in UC Variable Price 6

File

./uc_varprice.install, line 110
Installs the necessary table for the Variable Price product features.

Code

function uc_varprice_update_6001() {
  $added = array();
  $schema = uc_varprice_schema();

  // Add new fields
  foreach (array(
    'arbitrary',
    'selectable',
    'sel_widget',
    'sel_options',
  ) as $key) {
    db_add_field($added, 'uc_varprice_products', $key, $schema['uc_varprice_products']['fields'][$key]);
  }

  // Define all currently-existing varprice fields as arbitrary price only fields
  db_query('UPDATE {uc_varprice_products} SET arbitrary = 1');
  return $added;
}