You are here

function taxonomy_entity_index_update_7004 in Taxonomy Entity Index 7

Change not null and add default value to revision_id field.

File

./taxonomy_entity_index.install, line 142

Code

function taxonomy_entity_index_update_7004() {

  // Drop the primary key since we are changing one of its fields.
  db_drop_primary_key('taxonomy_entity_index');

  // Modify the schema of the revision_id field.
  db_change_field('taxonomy_entity_index', 'revision_id', 'revision_id', array(
    'type' => 'int',
    'unsigned' => TRUE,
    'not null' => TRUE,
    'default' => 0,
  ));

  // Re-add the primary key.
  db_add_primary_key('taxonomy_entity_index', array(
    'entity_type',
    'entity_id',
    'revision_id',
    'field_name',
    'delta',
  ));
}