Index: playlist/station_playlist.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/station/playlist/station_playlist.install,v
retrieving revision 1.8
diff -u -p -r1.8 station_playlist.install
--- playlist/station_playlist.install	11 Mar 2009 07:49:15 -0000	1.8
+++ playlist/station_playlist.install	19 Apr 2009 22:33:36 -0000
@@ -325,24 +325,19 @@ function station_playlist_schema() {
       'station_playlist_album'      => array('album'),
       'station_playlist_label'      => array('label'),
     ),
-//    'primary key' => array('vid, weight'),
+//    'primary key' => array('vid', 'weight'),
   );
 
   return $schema;
 }
 
 /**
- * Add a link field to the track.
+ * Implementation of hook_update_last_removed().
  */
-function station_playlist_update_101() {
-  $ret = array();
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      $ret[] = update_sql("ALTER TABLE {station_playlist_track} ADD COLUMN `link` VARCHAR(255) NOT NULL DEFAULT '' AFTER `label`;");
-    break;
-  }
-  return $ret;
+function station_playlist_update_last_removed() {
+  // We've removed the 5.x-1.x version of mymodule, including database updates.
+  // The next update function is mymodule_update_5200().
+  return 5110100;
 }
 
 /**
Index: program/station_program.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/station/program/station_program.install,v
retrieving revision 1.8
diff -u -p -r1.8 station_program.install
--- program/station_program.install	28 Nov 2008 19:22:06 -0000	1.8
+++ program/station_program.install	19 Apr 2009 22:33:36 -0000
@@ -241,33 +241,12 @@ function station_program_disable() {
 }
 
 /**
- * Rename the permissions.
- *
- * First update for the 5.1 branch, using the update naming convention layed
- * out in: http://drupal.org/node/114774#update-n
+ * Implementation of hook_update_last_removed().
  */
-function station_program_update_5100() {
-  $ret = array();
-
-  // Setup arrays holding regexps to match and the corresponding
-  // strings to replace them with, for use with preg_replace().
-  $old_perms = array(
-    '/edit own program/',
-  );
-  $new_perms = array(
-    'edit own program content',
-  );
-
-  // Now, loop over all the roles, and do the necessary transformations.
-  $query = db_query("SELECT rid, perm FROM {permission} ORDER BY rid");
-  while ($role = db_fetch_object($query)) {
-    $fixed_perm = preg_replace($old_perms, $new_perms, $role->perm);
-    if ($fixed_perm != $role->perm) {
-      $ret[] = update_sql("UPDATE {permission} SET perm = '$fixed_perm' WHERE rid = $role->rid");
-    }
-  }
-
-  return $ret;
+function station_program_update_last_removed() {
+  // We've removed the 5.x-1.x version of mymodule, including database updates.
+  // The next update function is mymodule_update_5200().
+  return 5100;
 }
 
 /**
Index: schedule/station_schedule.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/station/schedule/station_schedule.install,v
retrieving revision 1.20
diff -u -p -r1.20 station_schedule.install
--- schedule/station_schedule.install	29 Nov 2008 04:27:34 -0000	1.20
+++ schedule/station_schedule.install	19 Apr 2009 22:33:36 -0000
@@ -224,126 +224,12 @@ function station_schedule_schema() {
 }
 
 /**
- * Remove the onam field from station_schedule
+ * Implementation of hook_update_last_removed().
  */
-function station_schedule_update_5() {
-  $ret = array();
-
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      $ret[] = update_sql("ALTER TABLE {station_schedule} DROP COLUMN `onam`;");
-      break;
-  }
-  return $ret;
-}
-
-/**
- * Refactor the schedule table
- */
-function station_schedule_update_6() {
-  $ret = array();
-
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      // remove unscheduled times.
-      $ret[] = update_sql('DELETE FROM {station_schedule} WHERE program_nid = 0 OR program_nid IS NULL;');
-      // add our new fields and indexes
-      $ret[] = update_sql("ALTER TABLE {station_schedule}
-        ADD COLUMN `start` INTEGER UNSIGNED NOT NULL DEFAULT 0 AFTER `program_nid`,
-        ADD COLUMN `finish` INTEGER UNSIGNED NOT NULL DEFAULT 0 AFTER `start`,
-        ADD INDEX `station_schedule_start`(`start`);
-      ");
-      // drop the old indexes
-      $ret[] = update_sql("ALTER TABLE {station_schedule}
-        DROP INDEX `station_schedule_day`,
-        DROP INDEX `station_schedule_hour`;
-      ");
-      // drop old fields
-      $ret[] = update_sql("ALTER TABLE {station_schedule}
-        DROP COLUMN `archived`;
-      ");
-      $ret[] = update_sql("ALTER TABLE {station_schedule}
-        DROP COLUMN `day`,
-        DROP COLUMN `hour`;
-      ");
-
-      // set start and finish minutes
-      $ret[] = update_sql('UPDATE {station_schedule} SET start = (sid - 1) * 60, finish = start + 60');
-
-      // loop through and merge adjacent programs into a single row.
-      $adjacent_query = 'SELECT s.sid AS first_sid, t.sid AS second_sid, s.start, t.finish FROM {station_schedule} s INNER JOIN {station_schedule} t ON s.finish = t.start AND s.program_nid = t.program_nid LIMIT 1';
-      $result = db_query($adjacent_query);
-      while ($s = db_fetch_object($result)) {
-        $ret[] = update_sql('UPDATE {station_schedule} SET finish = '. (int)$s->finish .' WHERE sid = '. (int)$s->first_sid);
-        $ret[] = update_sql('DELETE FROM {station_schedule} WHERE sid = '. (int)$s->second_sid);
-        $result = db_query($adjacent_query);
-      }
-
-      // we aren't allowing an sid = 0 (it gets confused with false) so make it something bigger
-      $max = (int) db_result(db_query('SELECT MAX(sid)+1 FROM {station_schedule}'));
-      $ret[] = update_sql("UPDATE {station_schedule} SET sid = $max WHERE sid = 0");
-
-      // add our sequence
-      $ret[] = update_sql("INSERT INTO {sequences} (name, id) VALUES ('{station_schedule}_sid', $max)");
-
-      break;
-  }
-
-  return $ret;
-}
-
-/**
- * Fix album index.
- */
-function station_schedule_update_7() {
-  $ret = array();
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      $ret[] = update_sql('ALTER TABLE {station_playlist_track}
-        DROP INDEX `station_playlist_album`,
-        ADD INDEX `station_playlist_album` (`album`)');
-    break;
-  }
-  return $ret;
-}
-
-/**
- * Update to set the schema number for Drupal 5.0.
- *
- * Change the playlist node name from 4.7 to 5.0. We do this here because the
- * station_schedule module was split up into sub modules as part of the upgrade
- * and the station_playlist module isn't marked as installed, so the its
- * updates won't be called.
- */
-function station_schedule_update_100() {
-  $ret = array();
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      $ret[] = update_sql("UPDATE {node} SET type = 'station_playlist' WHERE type='program_playlist';");
-      $ret[] = update_sql("UPDATE {node_type} SET type = 'station_playlist' WHERE type='program_playlist';");
-    break;
-  }
-  return $ret;
-}
-
-/**
- * Add an archiveable setting.
- */
-function station_schedule_update_101() {
-  $ret = array();
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      $ret[] = update_sql('ALTER TABLE {station_schedule}
-        ADD COLUMN `may_archive` TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 AFTER `finish`;
-      ');
-    break;
-  }
-  return $ret;
+function station_schedule_update_last_removed() {
+  // We've removed the 5.x-1.x version of mymodule, including database updates.
+  // The next update function is mymodule_update_5200().
+  return 101;
 }
 
 /**
