You are here

function custom_breadcrumbs_features_install in Custom Breadcrumbs Features 7.2

Implements hook_install().

Add machine_name field in all installed breadcrumb tables.

File

./custom_breadcrumbs_features.install, line 77
Install file for custom_breadcrumbs_features.

Code

function custom_breadcrumbs_features_install() {
  $tables = array_keys(_custom_breadcrumbs_features_get_types());

  // Keep only tables installed.
  $tables = array_filter($tables, 'db_table_exists');

  // Add field machine_name.
  foreach ($tables as $table) {
    $schema = drupal_get_schema($table);
    db_add_field($table, 'machine_name', $schema['fields']['machine_name']);
    db_add_unique_key($table, 'machine_name', $schema['unique keys']['machine_name']);
  }
}