You are here

function commerce_coupon_update_7202 in Commerce Coupon 7.2

Add "changed" and "data' fields.

File

./commerce_coupon.install, line 234
Installation hooks and procedures for Commerce Coupon.

Code

function commerce_coupon_update_7202() {

  // Add "changed" field.
  if (!db_field_exists('commerce_coupon', 'changed')) {
    $field = array(
      'description' => 'The Unix timestamp when the coupon was most recently saved.',
      'type' => 'int',
      'not null' => TRUE,
      'default' => 0,
    );
    db_add_field('commerce_coupon', 'changed', $field);
  }

  // Add "data" field.
  if (!db_field_exists('commerce_coupon', 'data')) {
    $field = array(
      'type' => 'blob',
      'size' => 'big',
      'not null' => FALSE,
      'serialize' => TRUE,
      'description' => 'Everything else, serialized.',
    );
    db_add_field('commerce_coupon', 'data', $field);
  }
}