Index: weblinks.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/weblinks/weblinks.install,v
retrieving revision 1.10
diff -u -r1.10 weblinks.install
--- weblinks.install	11 Jul 2008 22:15:15 -0000	1.10
+++ weblinks.install	19 Jul 2008 04:40:34 -0000
@@ -19,42 +19,36 @@
   }
 }
 
+/**
+ * Implementation of hook_schema().
+ */
 function weblinks_schema() {
   $schema['weblinks'] = array(
     'fields' => array(
     'vid'    => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
     'nid'    => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
     'tid'    => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
-    'url'    => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
-    'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny')
+    'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'),
+    'url'    => array('type' => 'text', 'not null' => TRUE, 'default' => ''),
     ),
     'indexes' => array(
-      'nid'    => array('nid'),
-      'tid' => array('tid', 'vid')
+      'nid' => array('nid'),
+      'tid' => array('tid', 'vid'),
+      'url' => array('url (2048)'),
     ),
     'primary key' => array('vid'),
   );
   return $schema;
 }
 
-function weblinks_update_1() {
-  return _system_update_utf8(array('weblinks'));
-}
-
 /**
- * Expand url length to 255.
+ * Implementation of hook_schema().
+ * Change url to text; add an index on it.
  */
-function weblinks_update_2() {
+function weblinks_update_6100() {
   $ret = array();
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      $ret[] = update_sql('ALTER TABLE {weblinks} MODIFY url varchar(255)');
-      break;
-    case 'pgsql':
-      $ret[] = update_sql('ALTER TABLE {weblinks} ALTER url TYPE character varying(255)');
-      break;
-  }
+  db_change_field($ret, 'weblinks', 'url', 'url', array('type' => 'text', 'not null' => TRUE, 'default' => ''));
+  db_add_index($ret, 'weblinks', 'url', array('url (2048)'));
   return $ret;
 }
 
