function seochecklist_update_5001 in SEO Checklist 5.2
Update from 5.x-1.x to 5.x-2.x.
File
- ./
seochecklist.install, line 148 - Install, update and uninstall functions for the seochecklist module.
Code
function seochecklist_update_5001() {
$ret = array();
$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));
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
$ret[] = update_sql("ALTER TABLE {seo_checklist} DROP extra2");
$ret[] = update_sql("ALTER TABLE {seo_checklist} DROP extra3");
$ret[] = update_sql("ALTER TABLE {seo_checklist} DROP linked_seo");
$ret[] = update_sql("ALTER TABLE {seo_group} DROP subgroup");
break;
case 'pgsql':
$ret[] = update_sql("ALTER TABLE {seo_checklist} DROP COLUMN extra2");
$ret[] = update_sql("ALTER TABLE {seo_checklist} DROP COLUMN extra3");
$ret[] = update_sql("ALTER TABLE {seo_checklist} DROP COLUMN linked_seo");
$ret[] = update_sql("ALTER TABLE {seo_group} DROP COLUMN subgroup");
break;
}
$ret[] = update_sql("DROP TABLE {seo_subgroup}");
return $ret;
}