Index: CHANGELOG.txt
===================================================================
RCS file: /cvs/drupal/drupal/CHANGELOG.txt,v
retrieving revision 1.239
diff -u -p -r1.239 CHANGELOG.txt
--- CHANGELOG.txt	5 Dec 2007 21:31:59 -0000	1.239
+++ CHANGELOG.txt	8 Dec 2007 18:41:11 -0000
@@ -94,8 +94,8 @@ Drupal 6.0, xxxx-xx-xx (development vers
   contributed modules to work with databases other than MySQL.
 - Removed drupal.module. The functionality lives on as the Site network
   contributed module (http://drupal.org/project/site_network).
-- Removed old system updates. Updates from Drupal versions prior to 4.7.x will
-  require upgrading to 4.7.x or 5.x before upgrading to 6.x.
+- Removed old system updates. Updates from Drupal versions prior to 5.x will
+  require upgrading to 5.x before upgrading to 6.x.
 
 Drupal 5.4, 2007-12-05
 ----------------------
Index: update.php
===================================================================
RCS file: /cvs/drupal/drupal/update.php,v
retrieving revision 1.239
diff -u -p -r1.239 update.php
--- update.php	8 Dec 2007 14:06:20 -0000	1.239
+++ update.php	8 Dec 2007 18:41:12 -0000
@@ -125,153 +125,6 @@ function db_change_column(&$ret, $table,
 }
 
 /**
- * If the schema version for Drupal core is stored in the variables table
- * (4.6.x and earlier) move it to the schema_version column of the system
- * table.
- *
- * This function may be removed when update 156 is removed, which is the last
- * update in the 4.6 to 4.7 migration.
- */
-function update_fix_schema_version() {
-  if ($update_start = variable_get('update_start', FALSE)) {
-    // Some updates were made to the 4.6 branch and 4.7 branch. This sets
-    // temporary variables to prevent the updates from being executed twice and
-    // throwing errors.
-    switch ($update_start) {
-      case '2005-04-14':
-        variable_set('update_132_done', TRUE);
-        break;
-
-      case '2005-05-06':
-        variable_set('update_132_done', TRUE);
-        variable_set('update_135_done', TRUE);
-        break;
-
-      case '2005-05-07':
-        variable_set('update_132_done', TRUE);
-        variable_set('update_135_done', TRUE);
-        variable_set('update_137_done', TRUE);
-        break;
-
-    }
-    // The schema_version column (added below) was changed during 4.7beta.
-    // Update_170 is only for those beta users.
-    variable_set('update_170_done', TRUE);
-
-    $sql_updates = array(
-      '2004-10-31: first update since Drupal 4.5.0 release' => 110,
-      '2004-11-07' => 111, '2004-11-15' => 112, '2004-11-28' => 113,
-      '2004-12-05' => 114, '2005-01-07' => 115, '2005-01-14' => 116,
-      '2005-01-18' => 117, '2005-01-19' => 118, '2005-01-20' => 119,
-      '2005-01-25' => 120, '2005-01-26' => 121, '2005-01-27' => 122,
-      '2005-01-28' => 123, '2005-02-11' => 124, '2005-02-23' => 125,
-      '2005-03-03' => 126, '2005-03-18' => 127, '2005-03-21' => 128,
-      // The following three updates were made on the 4.6 branch
-      '2005-04-14' => 128, '2005-05-06' => 128, '2005-05-07' => 128,
-      '2005-04-08: first update since Drupal 4.6.0 release' => 129,
-      '2005-04-10' => 130, '2005-04-11' => 131, '2005-04-14' => 132,
-      '2005-04-24' => 133, '2005-04-30' => 134, '2005-05-06' => 135,
-      '2005-05-08' => 136, '2005-05-09' => 137, '2005-05-10' => 138,
-      '2005-05-11' => 139, '2005-05-12' => 140, '2005-05-22' => 141,
-      '2005-07-29' => 142, '2005-07-30' => 143, '2005-08-08' => 144,
-      '2005-08-15' => 145, '2005-08-25' => 146, '2005-09-07' => 147,
-      '2005-09-18' => 148, '2005-09-27' => 149, '2005-10-15' => 150,
-      '2005-10-23' => 151, '2005-10-28' => 152, '2005-11-03' => 153,
-      '2005-11-14' => 154, '2005-11-27' => 155, '2005-12-03' => 156,
-    );
-
-    // Add schema version column
-    switch ($GLOBALS['db_type']) {
-      case 'pgsql':
-        $ret = array();
-        db_add_column($ret, 'system', 'schema_version', 'smallint', array('not null' => TRUE, 'default' => -1));
-        break;
-
-      case 'mysql':
-      case 'mysqli':
-        db_query('ALTER TABLE {system} ADD schema_version smallint(3) not null default -1');
-        break;
-    }
-    // Set all enabled (contrib) modules to schema version 0 (installed)
-    db_query('UPDATE {system} SET schema_version = 0 WHERE status = 1');
-
-    // Set schema version for core
-    drupal_set_installed_schema_version('system', $sql_updates[$update_start]);
-    variable_del('update_start');
-  }
-}
-
-/**
- * System update 130 changes the sessions table, which breaks the update
- * script's ability to use session variables. This changes the table
- * appropriately.
- *
- * This code, including the 'update_sessions_fixed' variable, may be removed
- * when update 130 is removed. It is part of the Drupal 4.6 to 4.7 migration.
- */
-function update_fix_sessions() {
-  $ret = array();
-
-  if (drupal_get_installed_schema_version('system') < 130 && !variable_get('update_sessions_fixed', FALSE)) {
-    if ($GLOBALS['db_type'] == 'mysql') {
-      db_query("ALTER TABLE {sessions} ADD cache int(11) NOT NULL default '0' AFTER timestamp");
-    }
-    elseif ($GLOBALS['db_type'] == 'pgsql') {
-      db_add_column($ret, 'sessions', 'cache', 'int', array('default' => 0, 'not null' => TRUE));
-    }
-
-    variable_set('update_sessions_fixed', TRUE);
-  }
-}
-
-/**
- * System update 115 changes the watchdog table, which breaks the update
- * script's ability to use logging. This changes the table appropriately.
- *
- * This code, including the 'update_watchdog_115_fixed' variable, may be removed
- * when update 115 is removed. It is part of the Drupal 4.5 to 4.7 migration.
- */
-function update_fix_watchdog_115() {
-  if (drupal_get_installed_schema_version('system') < 115 && !variable_get('update_watchdog_115_fixed', FALSE)) {
-    if ($GLOBALS['db_type'] == 'mysql') {
-      $ret[] = update_sql("ALTER TABLE {watchdog} ADD severity tinyint(3) unsigned NOT NULL default '0'");
-    }
-    else if ($GLOBALS['db_type'] == 'pgsql') {
-      $ret[] = update_sql('ALTER TABLE {watchdog} ADD severity smallint');
-      $ret[] = update_sql('UPDATE {watchdog} SET severity = 0');
-      $ret[] = update_sql('ALTER TABLE {watchdog} ALTER COLUMN severity SET NOT NULL');
-      $ret[] = update_sql('ALTER TABLE {watchdog} ALTER COLUMN severity SET DEFAULT 0');
-    }
-
-    variable_set('update_watchdog_115_fixed', TRUE);
-  }
-}
-
-/**
- * System update 142 changes the watchdog table, which breaks the update
- * script's ability to use logging. This changes the table appropriately.
- *
- * This code, including the 'update_watchdog_fixed' variable, may be removed
- * when update 142 is removed. It is part of the Drupal 4.6 to 4.7 migration.
- */
-function update_fix_watchdog() {
-  if (drupal_get_installed_schema_version('system') < 142 && !variable_get('update_watchdog_fixed', FALSE)) {
-    switch ($GLOBALS['db_type']) {
-      case 'pgsql':
-        $ret = array();
-        db_add_column($ret, 'watchdog', 'referer', 'varchar(128)', array('not null' => TRUE, 'default' => "''"));
-        break;
-      case 'mysql':
-      case 'mysqli':
-        db_query("ALTER TABLE {watchdog} ADD COLUMN referer varchar(128) NOT NULL");
-        break;
-    }
-
-    variable_set('update_watchdog_fixed', TRUE);
-  }
-}
-
-/**
  * Perform one update and store the results which will later be displayed on
  * the finished page.
  *
@@ -500,184 +353,6 @@ function update_access_denied_page() {
 </ol>';
 }
 
-// This code may be removed later. It is part of the Drupal 4.5 to 4.8 migration.
-function update_fix_system_table() {
-  drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE);
-  $core_modules = array('aggregator', 'archive', 'block', 'blog', 'blogapi', 'book', 'comment', 'contact', 'drupal', 'filter', 'forum', 'help', 'legacy', 'locale', 'menu', 'node', 'page', 'path', 'ping', 'poll', 'profile', 'search', 'statistics', 'story', 'system', 'taxonomy', 'throttle', 'tracker', 'upload', 'user', 'watchdog');
-  foreach ($core_modules as $module) {
-    $old_path = "modules/$module.module";
-    $new_path = "modules/$module/$module.module";
-    db_query("UPDATE {system} SET filename = '%s' WHERE filename = '%s'", $new_path, $old_path);
-  }
-  $row = db_fetch_object(db_query_range('SELECT * FROM {system}', 0, 1));
-  if (!isset($row->weight)) {
-    $ret = array();
-    switch ($GLOBALS['db_type']) {
-      case 'pgsql':
-        db_add_column($ret, 'system', 'weight', 'smallint', array('not null' => TRUE, 'default' => 0));
-        $ret[] = update_sql('CREATE INDEX {system}_weight_idx ON {system} (weight)');
-        break;
-      case 'mysql':
-      case 'mysqli':
-        $ret[] = update_sql("ALTER TABLE {system} ADD weight tinyint(2) default '0' NOT NULL, ADD KEY (weight)");
-        break;
-    }
-  }
-}
-
-// This code may be removed later. It is part of the Drupal 4.6 to 4.7 migration.
-function update_fix_access_table() {
-  if (variable_get('update_access_fixed', FALSE)) {
-    return;
-  }
-
-  switch ($GLOBALS['db_type']) {
-    // Only for MySQL 4.1+
-    case 'mysqli':
-      break;
-    case 'mysql':
-      if (version_compare(mysql_get_server_info($GLOBALS['active_db']), '4.1.0', '<')) {
-        return;
-      }
-      break;
-    case 'pgsql':
-      return;
-  }
-
-  // Convert access table to UTF-8 if needed.
-  $result = db_fetch_array(db_query('SHOW CREATE TABLE {access}'));
-  if (!preg_match('/utf8/i', array_pop($result))) {
-    update_convert_table_utf8('access');
-  }
-
-  // Don't run again
-  variable_set('update_access_fixed', TRUE);
-}
-
-/**
- * Convert a single MySQL table to UTF-8.
- *
- * We change all text columns to their corresponding binary type,
- * then back to text, but with a UTF-8 character set.
- * See: http://dev.mysql.com/doc/refman/4.1/en/charset-conversion.html
- */
-function update_convert_table_utf8($table) {
-  $ret = array();
-  $types = array('char' => 'binary',
-                 'varchar' => 'varbinary',
-                 'tinytext' => 'tinyblob',
-                 'text' => 'blob',
-                 'mediumtext' => 'mediumblob',
-                 'longtext' => 'longblob');
-
-  // Get next table in list
-  $convert_to_binary = array();
-  $convert_to_utf8 = array();
-
-  // Set table default charset
-  $ret[] = update_sql('ALTER TABLE {'. $table .'} DEFAULT CHARACTER SET utf8');
-
-  // Find out which columns need converting and build SQL statements
-  $result = db_query('SHOW FULL COLUMNS FROM {'. $table .'}');
-  while ($column = db_fetch_array($result)) {
-    list($type) = explode('(', $column['Type']);
-    if (isset($types[$type])) {
-      $names = 'CHANGE `'. $column['Field'] .'` `'. $column['Field'] .'` ';
-      $attributes = ' DEFAULT '. ($column['Default'] == 'NULL' ? 'NULL ' :
-                     "'". db_escape_string($column['Default']) ."' ") .
-                    ($column['Null'] == 'YES' ? 'NULL' : 'NOT NULL');
-
-      $convert_to_binary[] = $names . preg_replace('/'. $type .'/i', $types[$type], $column['Type']) . $attributes;
-      $convert_to_utf8[] = $names . $column['Type'] .' CHARACTER SET utf8'. $attributes;
-    }
-  }
-
-  if (count($convert_to_binary)) {
-    // Convert text columns to binary
-    $ret[] = update_sql('ALTER TABLE {'. $table .'} '. implode(', ', $convert_to_binary));
-    // Convert binary columns to UTF-8
-    $ret[] = update_sql('ALTER TABLE {'. $table .'} '. implode(', ', $convert_to_utf8));
-  }
-  return $ret;
-}
-
-/**
- * Create tables for the split cache.
- *
- * This is part of the Drupal 4.7.x to 5.x migration.
- */
-function update_create_cache_tables() {
-
-  // If cache_filter exists, update is not necessary
-  if (db_table_exists('cache_filter')) {
-    return;
-  }
-
-  $ret = array();
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      $ret[] = update_sql("CREATE TABLE {cache_filter} (
-        cid varchar(255) NOT NULL default '',
-        data longblob,
-        expire int NOT NULL default '0',
-        created int NOT NULL default '0',
-        headers text,
-        PRIMARY KEY (cid),
-        INDEX expire (expire),
-      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
-      $ret[] = update_sql("CREATE TABLE {cache_menu} (
-        cid varchar(255) NOT NULL default '',
-        data longblob,
-        expire int NOT NULL default '0',
-        created int NOT NULL default '0',
-        headers text,
-        PRIMARY KEY (cid),
-        INDEX expire (expire),
-      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
-      $ret[] = update_sql("CREATE TABLE {cache_page} (
-        cid varchar(255) BINARY NOT NULL default '',
-        data longblob,
-        expire int NOT NULL default '0',
-         created int NOT NULL default '0',
-        headers text,
-        PRIMARY KEY (cid),
-        INDEX expire (expire),
-      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
-      break;
-    case 'pgsql':
-      $ret[] = update_sql("CREATE TABLE {cache_filter} (
-        cid varchar(255) NOT NULL default '',
-        data bytea,
-        expire int NOT NULL default '0',
-        created int NOT NULL default '0',
-        headers text,
-        PRIMARY KEY (cid),
-      )");
-      $ret[] = update_sql("CREATE TABLE {cache_menu} (
-        cid varchar(255) NOT NULL default '',
-        data bytea,
-        expire int NOT NULL default '0',
-        created int NOT NULL default '0',
-        headers text,
-        PRIMARY KEY (cid),
-      )");
-      $ret[] = update_sql("CREATE TABLE {cache_page} (
-        cid varchar(255) NOT NULL default '',
-        data bytea,
-        expire int NOT NULL default '0',
-        created int NOT NULL default '0',
-        headers text,
-        PRIMARY KEY (cid),
-      )");
-      $ret[] = update_sql("CREATE INDEX {cache_filter}_expire_idx ON {cache_filter} (expire)");
-      $ret[] = update_sql("CREATE INDEX {cache_menu}_expire_idx ON {cache_menu} (expire)");
-      $ret[] = update_sql("CREATE INDEX {cache_page}_expire_idx ON {cache_page} (expire)");
-      break;
-  }
-  return $ret;
-}
-
 /**
  * Create the batch table.
  *
@@ -840,10 +515,6 @@ if (!empty($update_free_access) || $user
   include_once './includes/batch.inc';
   drupal_load_updates();
 
-  update_fix_schema_version();
-  update_fix_watchdog_115();
-  update_fix_watchdog();
-  update_fix_sessions();
   update_fix_d6_requirements();
   update_fix_compatibility();
 
Index: modules/system/system.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.install,v
retrieving revision 1.204
diff -u -p -r1.204 system.install
--- modules/system/system.install	7 Dec 2007 11:55:13 -0000	1.204
+++ modules/system/system.install	8 Dec 2007 18:41:19 -0000
@@ -1036,536 +1036,6 @@ function system_schema() {
 // Updates for core.
 
 /**
- * @defgroup updates-4.7.x-extra Extra system updates for 4.7.x
- * @{
- */
-
-function system_update_180() {
-  $ret = array();
-
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      $ret[] = update_sql("ALTER TABLE {node} DROP PRIMARY KEY");
-      $ret[] = update_sql("ALTER TABLE {node} ADD PRIMARY KEY (nid, vid)");
-      $ret[] = update_sql("ALTER TABLE {node} ADD UNIQUE (vid)");
-      $ret[] = update_sql("ALTER TABLE {node} ADD INDEX (nid)");
-
-      $ret[] = update_sql("ALTER TABLE {node_counter} CHANGE nid nid INT(10) NOT NULL DEFAULT '0'");
-      break;
-    case 'pgsql':
-      $ret[] = update_sql("ALTER TABLE {node} DROP CONSTRAINT {node}_pkey"); // Change PK
-      $ret[] = update_sql("ALTER TABLE {node} ADD PRIMARY KEY (nid, vid)");
-      $ret[] = update_sql('DROP INDEX {node}_vid_idx'); // Change normal index to UNIQUE index
-      $ret[] = update_sql('CREATE UNIQUE INDEX {node}_vid_idx ON {node}(vid)');
-      $ret[] = update_sql('CREATE INDEX {node}_nid_idx ON {node}(nid)'); // Add index on nid
-      break;
-  }
-
-  return $ret;
-}
-
-function system_update_181() {
-  $ret = array();
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      $ret[] = update_sql("ALTER TABLE {profile_fields} ADD autocomplete TINYINT(1) NOT NULL AFTER visibility ;");
-      break;
-    case 'pgsql':
-      db_add_column($ret, 'profile_fields', 'autocomplete', 'smallint', array('not null' => TRUE, 'default' => 0));
-      break;
-  }
-  return $ret;
-}
-
-/**
- * The lid field in pgSQL should not be UNIQUE, but an INDEX.
- */
-function system_update_182() {
-  $ret = array();
-
-  if ($GLOBALS['db_type'] == 'pgsql') {
-    $ret[] = update_sql('ALTER TABLE {locales_target} DROP CONSTRAINT {locales_target}_lid_key');
-    $ret[] = update_sql('CREATE INDEX {locales_target}_lid_idx ON {locales_target} (lid)');
-  }
-
-  return $ret;
-}
-
-/**
- * Cid matching by MySQL should be case-sensitive.
- */
-function system_update_183() {
-  $ret = array();
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      $ret[] = update_sql("ALTER TABLE {cache} CHANGE cid cid varchar(255) BINARY NOT NULL default ''");
-      break;
-  }
-  return $ret;
-}
-
-function system_update_184() {
-  $ret = array();
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      $ret[] = update_sql("ALTER TABLE {access} CHANGE aid aid int(10) NOT NULL AUTO_INCREMENT ");
-      $ret[] = update_sql("ALTER TABLE {boxes} CHANGE bid bid int NOT NULL AUTO_INCREMENT ");
-      break;
-    case 'pgsql':
-       // No database update required for PostgreSQL because it already uses big SERIAL numbers.
-  }
-
-  return $ret;
-}
-
-/**
- * @} End of "defgroup updates-4.7-extra"
- */
-
-/**
- * @defgroup updates-4.7-to-5.0 System updates from 4.7 to 5.0
- * @{
- */
-
-function system_update_1000() {
-  $ret = array();
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-    $ret[] = update_sql("CREATE TABLE {blocks_roles} (
-      module varchar(64) NOT NULL,
-      delta varchar(32) NOT NULL,
-      rid int unsigned NOT NULL,
-      PRIMARY KEY (module, delta, rid)
-      ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
-    break;
-
-    case 'pgsql':
-    $ret[] = update_sql("CREATE TABLE {blocks_roles} (
-      module varchar(64) NOT NULL,
-      delta varchar(32) NOT NULL,
-      rid integer NOT NULL,
-      PRIMARY KEY (module, delta, rid)
-      );");
-    break;
-
-  }
-  return $ret;
-}
-
-function system_update_1001() {
-  // change DB schema for better poll support
-  $ret = array();
-
-  switch ($GLOBALS['db_type']) {
-    case 'mysqli':
-    case 'mysql':
-      // alter poll_votes table
-      $ret[] = update_sql("ALTER TABLE {poll_votes} ADD COLUMN chorder int NOT NULL default -1 AFTER uid");
-      break;
-
-    case 'pgsql':
-      db_add_column($ret, 'poll_votes', 'chorder', 'int', array('not null' => TRUE, 'default' => "'-1'"));
-      break;
-  }
-
-  return $ret;
-}
-
-function system_update_1002() {
-  // Make the forum's vocabulary the highest in list, if present
-  $ret = array();
-
-  if ($vid = (int) variable_get('forum_nav_vocabulary', 0)) {
-    $ret[] = update_sql('UPDATE {vocabulary} SET weight = -10 WHERE vid = '. $vid);
-  }
-
-  return $ret;
-}
-
-function system_update_1003() {
-  // Make use of guid in feed items
-  $ret = array();
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      $ret[] = update_sql("ALTER TABLE {aggregator_item} ADD guid varchar(255) AFTER timestamp ;");
-      break;
-    case 'pgsql':
-      db_add_column($ret, 'aggregator_item', 'guid', 'varchar(255)');
-      break;
-  }
-  return $ret;
-}
-
-
-function system_update_1004() {
-  // Increase the size of bid in boxes and aid in access
-  $ret = array();
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-    $ret[] = update_sql("ALTER TABLE {access} CHANGE `aid` `aid` int  NOT NULL AUTO_INCREMENT ");
-    $ret[] = update_sql("ALTER TABLE {boxes} CHANGE `bid` `bid` int NOT NULL AUTO_INCREMENT ");
-      break;
-    case 'pgsql':
-      // No database update required for PostgreSQL because it already uses big SERIAL numbers.
-      break;
-  }
-  return $ret;
-}
-
-function system_update_1005() {
-  // Add ability to create dynamic node types like the CCK module
-  $ret = array();
-
-  // The node_type table may already exist for anyone who ever used CCK in 4.7,
-  // even if CCK is no longer installed. We need to make sure any previously
-  // created table gets renamed before we create the new node_type table in
-  // order to ensure that the new table gets created without errors.
-  // TODO: This check should be removed for Drupal 6.
-  if (db_table_exists('node_type')) {
-    switch ($GLOBALS['db_type']) {
-      case 'mysql':
-      case 'mysqli':
-        $ret[] = update_sql('RENAME TABLE {node_type} TO {node_type_content}');
-        break;
-
-      case 'pgsql':
-        $ret[] = update_sql('ALTER TABLE {node_type} RENAME TO {node_type_content}');
-        break;
-    }
-  }
-
-  switch ($GLOBALS['db_type']) {
-    case 'mysqli':
-    case 'mysql':
-      // Create node_type table
-      $ret[] = update_sql("CREATE TABLE {node_type} (
-        type varchar(32) NOT NULL,
-        name varchar(255) NOT NULL,
-        module varchar(255) NOT NULL,
-        description mediumtext NOT NULL,
-        help mediumtext NOT NULL,
-        has_title tinyint unsigned NOT NULL,
-        title_label varchar(255) NOT NULL default '',
-        has_body tinyint unsigned NOT NULL,
-        body_label varchar(255) NOT NULL default '',
-        min_word_count smallint unsigned NOT NULL,
-        custom tinyint NOT NULL DEFAULT '0',
-        modified tinyint NOT NULL DEFAULT '0',
-        locked tinyint NOT NULL DEFAULT '0',
-        orig_type varchar(255) NOT NULL default '',
-        PRIMARY KEY (type)
-        ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
-      break;
-
-    case 'pgsql':
-      // add new unsigned types for pgsql
-      $ret[] = update_sql("CREATE DOMAIN int_unsigned integer CHECK (VALUE >= 0)");
-      $ret[] = update_sql("CREATE DOMAIN smallint_unsigned smallint CHECK (VALUE >= 0)");
-      $ret[] = update_sql("CREATE DOMAIN bigint_unsigned bigint CHECK (VALUE >= 0)");
-
-      $ret[] = update_sql("CREATE TABLE {node_type} (
-        type varchar(32) NOT NULL,
-        name varchar(255) NOT NULL,
-        module varchar(255) NOT NULL,
-        description text NOT NULL,
-        help text NOT NULL,
-        has_title smallint_unsigned NOT NULL,
-        title_label varchar(255) NOT NULL default '',
-        has_body smallint_unsigned NOT NULL,
-        body_label varchar(255) NOT NULL default '',
-        min_word_count smallint_unsigned NOT NULL,
-        custom smallint NOT NULL DEFAULT '0',
-        modified smallint NOT NULL DEFAULT '0',
-        locked smallint NOT NULL DEFAULT '0',
-        orig_type varchar(255) NOT NULL default '',
-        PRIMARY KEY (type)
-        );");
-      break;
-  }
-
-  // Insert default user-defined node types into the database.
-  $types = array(
-    array(
-      'type' => 'page',
-      'name' => t('Page'),
-      'module' => 'node',
-      'description' => t('If you want to add a static page, like a contact page or an about page, use a page.'),
-      'custom' => TRUE,
-      'modified' => TRUE,
-      'locked' => FALSE,
-    ),
-    array(
-      'type' => 'story',
-      'name' => t('Story'),
-      'module' => 'node',
-      'description' => t('Stories are articles in their simplest form: they have a title, a teaser and a body, but can be extended by other modules. The teaser is part of the body too. Stories may be used as a personal blog or for news articles.'),
-      'custom' => TRUE,
-      'modified' => TRUE,
-      'locked' => FALSE,
-    )
-  );
-
-  foreach ($types as $type) {
-    $type = (object) _node_type_set_defaults($type);
-    node_type_save($type);
-  }
-
-  cache_clear_all();
-
-  include_once './'. drupal_get_path('module', 'system') .'/system.admin.inc';
-  system_modules();
-
-  menu_rebuild();
-  node_types_rebuild();
-
-  // Migrate old values for 'minimum_x_size' variables to the node_type table.
-  $query = db_query('SELECT type FROM {node_type}');
-  while ($result = db_fetch_object($query)) {
-    $variable_name = 'minimum_'. $result->type .'_size';
-    if ($value = db_fetch_object(db_query("SELECT value FROM {variable} WHERE name = '%s'", $variable_name))) {
-      $value = (int) unserialize($value->value);
-      db_query("UPDATE {node_type} SET min_word_count = %d, modified = %d WHERE type = '%s'", $value, 1, $result->type);
-      variable_del($variable_name);
-    }
-  }
-
-  node_types_rebuild();
-
-  return $ret;
-}
-
-function system_update_1006() {
-  // Add a customizable title to all blocks.
-  $ret = array();
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-    $ret[] = update_sql("ALTER TABLE {blocks} ADD title VARCHAR(64) NOT NULL DEFAULT ''");
-      break;
-    case 'pgsql':
-      db_add_column($ret, 'blocks', 'title', 'varchar(64)', array('default' => "''", 'not null' => TRUE));
-      break;
-  }
-  // Migrate custom block titles to new column.
-  $boxes = db_query('SELECT bid, title from {boxes}');
-  while ($box = db_fetch_object($boxes)) {
-    db_query("UPDATE {blocks} SET title = '%s' WHERE delta = %d and module = 'block'", $box->title, $box->bid);
-  }
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      $ret[] = update_sql('ALTER TABLE {boxes} DROP title');
-      break;
-    case 'pgsql':
-      $ret[] = update_sql('ALTER TABLE {boxes} DROP COLUMN title');
-      break;
-  }
-  return $ret;
-}
-
-function system_update_1007() {
-  $ret = array();
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      $ret[] = update_sql("ALTER TABLE {aggregator_item} ADD INDEX (fid)");
-      break;
-    case 'pgsql':
-      $ret[] = update_sql("CREATE INDEX {aggregator_item}_fid_idx ON {aggregator_item} (fid)");
-      break;
-  }
-  return $ret;
-}
-
-/**
- * Performance update for queries that are related to the locale.module
- */
-function system_update_1008() {
-  $ret = array();
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      $ret[] = update_sql('ALTER TABLE {locales_source} ADD KEY source (source(30))');
-      break;
-    case 'pgsql':
-      $ret[] = update_sql("CREATE INDEX {locales_source}_source_idx on {locales_source} (source)");
-  }
-
-  return $ret;
-}
-
-function system_update_1010() {
-  $ret = array();
-
-  // Disable urlfilter.module, if it exists.
-  if (module_exists('urlfilter')) {
-    module_disable(array('urlfilter'));
-    $ret[] = update_sql("UPDATE {filter_formats} SET module = 'filter', delta = 3 WHERE module = 'urlfilter'");
-    $ret[] = t('URL Filter module was disabled; this functionality has now been added to core.');
-  }
-
-  return $ret;
-}
-
-function system_update_1011() {
-  $ret = array();
-  $ret[] = update_sql('UPDATE {menu} SET mid = 2 WHERE mid = 0');
-  cache_clear_all();
-  return $ret;
-}
-
-function system_update_1012() {
-  $ret = array();
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      $ret[] = update_sql("ALTER TABLE {file_revisions} ADD INDEX(vid)");
-      $ret[] = update_sql("ALTER TABLE {files} ADD INDEX(nid)");
-      break;
-    case 'pgsql':
-      $ret[] = update_sql('CREATE INDEX {file_revisions}_vid_idx ON {file_revisions} (vid)');
-      $ret[] = update_sql('CREATE INDEX {files}_nid_idx ON {files} (nid)');
-      break;
-  }
-  return $ret;
-}
-
-function system_update_1013() {
-  $ret = array();
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      $ret[] = update_sql("ALTER TABLE {sessions} CHANGE COLUMN sid sid varchar(64) NOT NULL default ''");
-      break;
-    case 'pgsql':
-      db_change_column($ret, 'sessions', 'sid', 'sid', 'varchar(64)',  array('not null' => TRUE, 'default' => "''"));
-      break;
-  }
-  return $ret;
-}
-
-function system_update_1014() {
-  variable_del('cron_busy');
-  return array();
-}
-
-/**
- * Add an index on watchdog type.
- */
-function system_update_1015() {
-  $ret = array();
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      $ret[] = update_sql('ALTER TABLE {watchdog} ADD INDEX (type)');
-      break;
-    case 'pgsql':
-      $ret[] = update_sql('CREATE INDEX {watchdog}_type_idx ON {watchdog}(type)');
-      break;
-  }
-  return $ret;
-}
-
-/**
- * Allow for longer URL encoded (%NN) UTF-8 characters in the location field of watchdog table.
- */
-function system_update_1016() {
-  $ret = array();
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      $ret[] = update_sql("ALTER TABLE {watchdog} CHANGE COLUMN location location text NOT NULL");
-      break;
-    case 'pgsql':
-      db_change_column($ret, 'watchdog', 'location', 'location', 'text',  array('not null' => TRUE, 'default' => "''"));
-      break;
-  }
-  return $ret;
-}
-
-/**
- * Allow role names to be up to 64 characters.
- */
-function system_update_1017() {
-  $ret = array();
-  switch ($GLOBALS['db_type']) {
-    case 'pgsql':
-      db_change_column($ret, 'role', 'name', 'name', 'varchar(64)', array('not null' => TRUE, 'default' => "''"));
-      break;
-    case 'mysql':
-    case 'mysqli':
-      $ret[] = update_sql("ALTER TABLE {role} CHANGE name name varchar(64) NOT NULL default ''");
-      break;
-  }
-  return $ret;
-}
-
-/**
- * Change break tag (was removed, see 1020).
- */
-function system_update_1018() {
-  variable_set('update_1020_ok', TRUE);
-  return array();
-}
-
-/**
- * Change variable format for user-defined e-mails.
- */
-function system_update_1019() {
-  $message_ids = array('welcome_subject', 'welcome_body',
-                       'approval_subject', 'approval_body',
-                       'pass_subject', 'pass_body',
-  );
-  foreach ($message_ids as $id) {
-    // Replace all %vars with !vars
-    if ($message = variable_get('user_mail_'. $id, NULL)) {
-      $fixed = preg_replace('/%([A-Za-z_-]+)/', '!\1', $message);
-      variable_set('user_mail_'. $id, $fixed);
-    }
-  }
-  return array();
-}
-
-/**
- * Change break tag back (was removed from head).
- */
-function system_update_1020() {
-  $ret = array();
-  if (!variable_get('update_1020_ok', FALSE)) {
-    $ret[] = update_sql("UPDATE {node_revisions} SET body = REPLACE(body, '<break>', '<!--break-->')");
-  }
-  variable_del('update_1020_ok');
-  return $ret;
-}
-
-/**
- * Update two more variables that were missing from system_update_1019.
- */
-function system_update_1021() {
-  $message_ids = array('admin_body', 'admin_subject');
-  foreach ($message_ids as $id) {
-    // Replace all %vars with !vars
-    if ($message = variable_get('user_mail_'. $id, NULL)) {
-      $fixed = preg_replace('/%([A-Za-z_-]+)/', '!\1', $message);
-      variable_set('user_mail_'. $id, $fixed);
-    }
-  }
-  return array();
-}
-
-/**
- * @} End of "defgroup updates-4.7-to-5.0"
- */
-
-
-/**
  * @defgroup updates-5.x-extra Extra system updates for 5.x
  * @{
  */
