You are here

function node_convert_update_7001 in Node Convert 7

Create machine names for all node conversion templates.

File

./node_convert.install, line 86
Installs necessary tables for node convert templates.

Code

function node_convert_update_7001() {

  // Load the node convert module, so we have access to constants and API.
  module_load_include('module', 'node_convert');
  if (!db_field_exists(NODE_CONVERT_TEMPLATE_TABLE, 'machine_name')) {

    // Add the new string machine name field for ctools.
    db_add_field(NODE_CONVERT_TEMPLATE_TABLE, 'machine_name', array(
      'type' => 'varchar',
      'length' => 255,
      'not null' => TRUE,
      'default' => '',
      'description' => 'The unique string identifier for a conversion template.',
    ));

    // Force drupal's schema to be rebuilt
    drupal_get_schema(NODE_CONVERT_TEMPLATE_TABLE, TRUE);
    _node_convert_recreate_identifiers();
  }
}