You are here

function nodewords_update_6120 in Nodewords: D6 Meta Tags 6

Same name and namespace in other branches
  1. 6.2 nodewords.install \nodewords_update_6120()

Implements hook_update_N().

File

./nodewords.install, line 613
Installation file for nodewords.module.

Code

function nodewords_update_6120() {
  $ret = array();
  db_drop_unique_key($ret, 'nodewords', 'tin');
  db_change_field($ret, 'nodewords', 'type', 'type', array(
    'type' => 'varchar',
    'length' => 16,
    'not null' => TRUE,
    'default' => '',
  ));
  db_change_field($ret, 'nodewords', 'id', 'id', array(
    'type' => 'varchar',
    'length' => 255,
    'not null' => TRUE,
    'default' => '',
  ));
  db_change_field($ret, 'nodewords', 'name', 'name', array(
    'type' => 'varchar',
    'length' => 32,
    'not null' => TRUE,
    'default' => '',
  ));
  db_add_unique_key($ret, 'nodewords', 'tin', array(
    'type',
    'id',
    'name',
  ));
  db_drop_unique_key($ret, 'nodewords_custom', 'path');
  db_change_field($ret, 'nodewords_custom', 'path', 'path', array(
    'type' => 'varchar',
    'length' => 255,
    'not null' => TRUE,
    'default' => '',
  ));
  db_add_unique_key($ret, 'nodewords_custom', 'path', array(
    'path',
  ));
  db_change_field($ret, 'nodewords_custom', 'weight', 'weight', array(
    'type' => 'int',
    'size' => 'small',
    'not null' => TRUE,
    'default' => 0,
  ));
  if (!db_column_exists('nodewords_custom', 'enabled')) {
    db_add_field($ret, 'nodewords_custom', 'enabled', array(
      'type' => 'int',
      'size' => 'small',
      'not null' => TRUE,
      'default' => 1,
    ));
  }
  return $ret;
}