You are here

function i18n_commerce_product_install in Internationalization for commerce product 7

Implements hook_install().

File

./i18n_commerce_product.install, line 25
Installation file for i18n_commerce_product module.

Code

function i18n_commerce_product_install() {
  if (!db_field_exists('commerce_product', 'tproduct_id')) {
    db_add_field('commerce_product', 'tproduct_id', array(
      'description' => 'The translation set id for this commerce product, which equals the product id of the source post in each set.',
      'type' => 'int',
      'unsigned' => TRUE,
      'not null' => FALSE,
      'default' => 0,
    ));
  }
  db_drop_unique_key('commerce_product', 'sku');
  db_add_unique_key('commerce_product', 'sku', array(
    'sku',
    'language',
  ));
}