You are here

function comment_update_7008 in Drupal 7

Update database to match Drupal 7 schema.

Related topics

File

modules/comment/comment.install, line 363
Install, update and uninstall functions for the comment module.

Code

function comment_update_7008() {

  // Update default status to 1.
  db_change_field('comment', 'status', 'status', array(
    'type' => 'int',
    'unsigned' => TRUE,
    'not null' => TRUE,
    'default' => 1,
    'size' => 'tiny',
  ));

  // Realign indexes.
  db_drop_index('comment', 'comment_status_pid');
  db_add_index('comment', 'comment_status_pid', array(
    'pid',
    'status',
  ));
  db_drop_index('comment', 'comment_pid_status');
  db_drop_index('comment', 'nid');
}