Index: modules/aggregator/aggregator.install =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.install,v retrieving revision 1.20 diff -u -p -r1.20 aggregator.install --- modules/aggregator/aggregator.install 22 Dec 2008 19:38:31 -0000 1.20 +++ modules/aggregator/aggregator.install 29 Apr 2009 22:14:56 -0000 @@ -124,10 +124,8 @@ function aggregator_schema() { 'description' => 'Title of the feed.', ), 'url' => array( - 'type' => 'varchar', - 'length' => 255, + 'type' => 'text', 'not null' => TRUE, - 'default' => '', 'description' => 'URL to the feed.', ), 'refresh' => array( @@ -143,10 +141,8 @@ function aggregator_schema() { 'description' => 'Last time feed was checked for new items, as Unix timestamp.', ), 'link' => array( - 'type' => 'varchar', - 'length' => 255, + 'type' => 'text', 'not null' => TRUE, - 'default' => '', 'description' => 'The parent website of the feed; comes from the <link> element in the feed.', ), 'description' => array( @@ -191,7 +187,7 @@ function aggregator_schema() { ), 'primary key' => array('fid'), 'unique keys' => array( - 'url' => array('url'), + 'url' => array(array('url', 255)), 'title' => array('title'), ), ); @@ -218,10 +214,8 @@ function aggregator_schema() { 'description' => 'Title of the feed item.', ), 'link' => array( - 'type' => 'varchar', - 'length' => 255, + 'type' => 'text', 'not null' => TRUE, - 'default' => '', 'description' => 'Link to the feed item.', ), 'author' => array( @@ -252,6 +246,7 @@ function aggregator_schema() { 'primary key' => array('iid'), 'indexes' => array( 'fid' => array('fid'), + 'guid' => array('guid'), ), ); @@ -259,6 +254,11 @@ function aggregator_schema() { } /** + * @defgroup updates-6.x-to-7.x System updates from 6.x to 7.x + * @{ + */ + +/** * Add hash column to aggregator_feed table. */ function aggregator_update_7000() { @@ -266,3 +266,22 @@ function aggregator_update_7000() { db_add_field($ret, 'aggregator_feed', 'hash', array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => '')); return $ret; } + +/** + * Allow longer URLs and add an index on feed_item.guid. + */ +function aggregator_update_7001() { + $ret = array(); + db_drop_unique_key($ret, 'aggregator_feed', 'url'); + db_change_field($ret, 'aggregator_feed', 'url', 'url', array('type' => 'text', 'not null' => TRUE, 'description' => 'URL to the feed.')); + db_change_field($ret, 'aggregator_feed', 'link', 'link', array('type' => 'text', 'not null' => TRUE, 'description' => 'The parent website of the feed; comes from the <link> element in the feed.')); + db_change_field($ret, 'aggregator_item', 'link', 'link', array( 'type' => 'text', 'not null' => TRUE, 'description' => 'Link to the feed item.')); + db_add_index($ret, 'aggregator_item', 'guid', array('guid')); + db_add_unique_key($ret, 'aggregator_feed', 'url', array(array('url', 255))); + return $ret; +} + +/** + * @} End of "defgroup updates-6.x-to-7.x" + * The next series of updates should start at 8000. + */