You are here

function commerce_uuid_schema_alter in Commerce UUID 7

Implements hook_schema_alter().

File

./commerce_uuid.install, line 11

Code

function commerce_uuid_schema_alter(&$schema = array()) {
  $field = uuid_schema_field_definition();

  // Alter the schema definition for the commerce_bundle_item entity type.
  if (module_exists('commerce_bundle_item')) {
    if (isset($schema['commerce_bundle_item'])) {
      $schema['commerce_bundle_item']['fields']['uuid'] = $field;
    }
  }

  // Alter the schema definition for the commerce_customer_profile entity type.
  if (isset($schema['commerce_customer_profile'])) {
    $schema['commerce_customer_profile']['fields']['uuid'] = $field;
    $schema['commerce_customer_profile_revision']['fields']['vuuid'] = $field;
  }

  // Alter the schema definition for the commerce_line_item entity type.
  if (isset($schema['commerce_line_item'])) {
    $schema['commerce_line_item']['fields']['uuid'] = $field;
  }

  // Alter the schema definition for the commerce_order entity type.
  if (isset($schema['commerce_order'])) {
    $schema['commerce_order']['fields']['uuid'] = $field;
    $schema['commerce_order_revision']['fields']['vuuid'] = $field;
  }

  // Alter the schema definition for the commerce_payment_transaction entity type.
  if (isset($schema['commerce_payment_transaction'])) {
    $schema['commerce_payment_transaction']['fields']['uuid'] = $field;
    $schema['commerce_payment_transaction_revision']['fields']['vuuid'] = $field;
  }

  // Alter the schema definition for the commerce_product entity type.
  if (isset($schema['commerce_product'])) {
    $schema['commerce_product']['fields']['uuid'] = $field;
    $schema['commerce_product_revision']['fields']['vuuid'] = $field;
  }
}