You are here

function seochecklist_update_6001 in SEO Checklist 6.2

Same name and namespace in other branches
  1. 6.3 seochecklist.install \seochecklist_update_6001()
  2. 7.3 seochecklist.install \seochecklist_update_6001()

Implementation of hook_update_N().

Move linked_seo, extra2, extra3 columns to Drupal variables since they are representing 1 value only. Remove subgroup from seo_group since we don't use it anymore.

File

./seochecklist.install, line 260

Code

function seochecklist_update_6001() {
  $query = db_query("SELECT linked_seo FROM {seo_checklist} ORDER BY id DESC LIMIT 1");
  $result = db_fetch_object($query);
  variable_set('seo_checklist_link', intval($result->linked_seo));
  $query = db_query("SELECT extra2, extra3 FROM {seo_checklist} WHERE id = 1");
  $result = db_fetch_object($query);
  variable_set('seo_checklist_thanks', intval($result->extra2));
  variable_set('seo_checklist_podcast', intval($result->extra3));
  $ret = array();
  db_drop_field($ret, 'seo_checklist', 'extra2');
  db_drop_field($ret, 'seo_checklist', 'extra3');
  db_drop_field($ret, 'seo_checklist', 'linked_seo');
  db_drop_field($ret, 'seo_group', 'subgroup');
  return $ret;
}