You are here

function feeds_update_7205 in Feeds 8.2

Same name and namespace in other branches
  1. 7.2 feeds.install \feeds_update_7205()

Shorten {feeds_item}.entity_type to 32 chars and shorten relevant indexes.

File

./feeds.install, line 554
Schema definitions install/update/uninstall hooks.

Code

function feeds_update_7205() {
  db_drop_primary_key('feeds_item');
  db_drop_index('feeds_item', 'lookup_url');
  db_drop_index('feeds_item', 'lookup_guid');
  db_drop_index('feeds_item', 'global_lookup_url');
  db_drop_index('feeds_item', 'global_lookup_guid');
  db_change_field('feeds_item', 'entity_type', 'entity_type', array(
    'type' => 'varchar',
    'length' => 32,
    'not null' => TRUE,
    'default' => '',
    'description' => 'The entity type.',
  ));
  db_add_primary_key('feeds_item', array(
    'entity_type',
    'entity_id',
  ));
  db_add_index('feeds_item', 'lookup_url', array(
    'entity_type',
    'id',
    'feed_nid',
    array(
      'url',
      128,
    ),
  ));
  db_add_index('feeds_item', 'lookup_guid', array(
    'entity_type',
    'id',
    'feed_nid',
    array(
      'guid',
      128,
    ),
  ));
  db_add_index('feeds_item', 'global_lookup_url', array(
    'entity_type',
    array(
      'url',
      128,
    ),
  ));
  db_add_index('feeds_item', 'global_lookup_guid', array(
    'entity_type',
    array(
      'guid',
      128,
    ),
  ));
}