function comment_update_7008

Update database to match Drupal 7 schema.

Related topics

File

modules/comment/comment.install, line 363

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');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.