Index: chessboard.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/chessboard/chessboard.install,v
retrieving revision 1.5
diff -u -p -r1.5 chessboard.install
--- chessboard.install	24 Dec 2010 23:31:00 -0000	1.5
+++ chessboard.install	2 Jan 2011 21:17:31 -0000
@@ -11,3 +11,47 @@
  */
 function chessboard_uninstall() {
 }
+
+/**
+ * Upgrade the {filter} table for Chessboard Renderer filters.
+ */
+function chessboard_update_7000() {
+  // Get an array of the renamed filter deltas, organized by module.
+  $renamed_deltas = array(
+    'chessboard' => array(
+      '0' => 'chessboard_filter_diagram',
+    ),
+  );
+
+  // Loop through each filter and make changes to the core filter table by
+  // each record from the old to the new table.
+  foreach ($renamed_deltas as $module => $deltas) {
+    foreach ($deltas as $old_delta => $new_name) {
+      $query = db_select('d6_upgrade_filter')
+        ->fields('d6_upgrade_filter', array('format', 'weight'))
+        ->condition('module', $module)
+        ->condition('delta', $old_delta)
+        ->distinct();
+
+      foreach ($query->execute() as $record) {
+        // Port the filter settings.
+        $settings = array();
+
+        db_insert('filter')
+          ->fields(array(
+            'format' => $record->format,
+            'module' => $module,
+            'name' => $new_name,
+            'weight' => $record->weight,
+            'settings' => serialize($settings),
+            'status' => 1,
+          ))
+          ->execute();
+      }
+      db_delete('d6_upgrade_filter')
+        ->condition('module', $module)
+        ->condition('delta', $old_delta)
+        ->execute();
+    }
+  }
+}
