uc_order_update_7001

  1. drupal
    1. 7 uc_order.install function
Drupal 7 uc_order_update_7001()

Add currency code field.

File

sites/all/modules/ubercart/uc_order/uc_order.install, line 718
Install, update and uninstall functions for the uc_order module.

Code

function uc_order_update_7001() {
  // Column may have been added by uc_order_update_6018() in 6.x-2.x.
  if (!db_field_exists('uc_orders', 'currency')) {
    db_add_field('uc_orders', 'currency', array(
      'type' => 'char', 
      'length' => 3, 
      'not null' => TRUE, 
      'default' => '',
    ));
    db_update('uc_orders')
      ->fields(array('currency' => variable_get('uc_currency_code', 'USD')))
      ->execute();
  }
}