You are here

function commerce_order_update_7108 in Commerce Core 7

Allow NULL values for order_number and revision_id on {commerce_order}, and order_number on {commerce_order_revision}.

File

modules/order/commerce_order.install, line 441

Code

function commerce_order_update_7108() {
  $order_number_spec = array(
    'description' => 'The order number displayed to the customer.',
    'type' => 'varchar',
    'length' => 255,
    'not null' => FALSE,
  );
  $revision_id_spec = array(
    'description' => 'The current {commerce_order_revision}.revision_id version identifier.',
    'type' => 'int',
    'unsigned' => TRUE,
    'not null' => FALSE,
    'default' => 0,
  );
  $order_number_revision_spec = array(
    'description' => 'The order number displayed to the customer for this revision.',
    'type' => 'varchar',
    'length' => 255,
    'not null' => FALSE,
  );
  db_change_field('commerce_order', 'order_number', 'order_number', $order_number_spec);
  db_change_field('commerce_order', 'revision_id', 'revision_id', $revision_id_spec);
  db_change_field('commerce_order_revision', 'order_number', 'order_number', $order_number_revision_spec);
  return t('Schema for the commerce_order and commerce_order_revision tables has been updated.');
}