You are here

function commerce_addressbook_update_7300 in Commerce Addressbook 7.3

Apply the schema updates from 7.x.2.x to 7.x.3.x.

File

./commerce_addressbook.install, line 73

Code

function commerce_addressbook_update_7300() {
  if (db_field_exists('commerce_addressbook_defaults', 'cad_id')) {

    // Deleting the field also drops the primary key.
    db_drop_field('commerce_addressbook_defaults', 'cad_id');
    db_add_unique_key('commerce_addressbook_defaults', 'uid_type', array(
      'uid',
      'type',
    ));
    db_change_field('commerce_addressbook_defaults', 'profile_id', 'profile_id', array(
      'description' => 'Numeric ID of the customer profile in the local database.',
      'type' => 'int',
      'unsigned' => TRUE,
      'not null' => TRUE,
    ), array(
      'profile_id' => array(
        'profile_id',
      ),
    ));
  }
}