You are here

function commerce_invoice_update_7100 in Commerce Invoice 7

Add the type field to the schema

File

./commerce_invoice.install, line 96

Code

function commerce_invoice_update_7100(&$sandbox) {

  // Add type
  if (!db_field_exists('commerce_invoice', 'type')) {
    $type = array(
      'description' => 'The type of this invoice.',
      'type' => 'varchar',
      'length' => 255,
      'not null' => TRUE,
      'default' => '',
    );
    db_add_field('commerce_invoice', 'type', $type);
    db_update('commerce_invoice')
      ->fields(array(
      'type' => 'commerce_invoice',
    ))
      ->execute();
  }
}