You are here

function field_group_update_7001 in Field Group 7.2

Same name and namespace in other branches
  1. 7 field_group.install \field_group_update_7001()

Update hook on the field_group table to add an unique identifier.

File

./field_group.install, line 208
Fieldgroup module install file.

Code

function field_group_update_7001() {
  if (!db_field_exists('field_group', 'identifier')) {

    // Add the new string identifier field for ctools.
    db_add_field('field_group', 'identifier', array(
      'type' => 'varchar',
      'length' => 255,
      'not null' => TRUE,
      'default' => '',
      'description' => 'The unique string identifier for a group.',
    ));
    module_load_include('module', 'field_group');
    _field_group_recreate_identifiers();
  }
  db_update('system')
    ->fields(array(
    'weight' => 1,
  ))
    ->condition('name', 'field_group')
    ->execute();
}