function xmlsitemap_update_6204 in XML sitemap 7.2
Same name and namespace in other branches
- 6.2 xmlsitemap.install \xmlsitemap_update_6204()
Convert {xmlsitemap}.context_hash to replace {xmlsitemap}.smid.
1 call to xmlsitemap_update_6204()
- xmlsitemap_update_7203 in ./
xmlsitemap.install - Convert {xmlsitemap}.context_hash to replace {xmlsitemap}.smid.
File
- ./
xmlsitemap.install, line 513 - Install, update and uninstall functions for the xmlsitemap module.
Code
function xmlsitemap_update_6204() {
if (db_field_exists('xmlsitemap_sitemap', 'context_hash')) {
db_drop_unique_key('xmlsitemap_sitemap', 'context_hash');
db_drop_field('xmlsitemap_sitemap', 'smid');
// Rename context_hash to the new smid column.
$smid_field = array(
'description' => 'The sitemap ID (the hashed value of {xmlsitemap}.context.',
'type' => 'varchar',
'length' => 64,
'not null' => TRUE,
);
db_change_field('xmlsitemap_sitemap', 'context_hash', 'smid', $smid_field);
// Re-add the primary key now that the smid field is changed.
// We don't need to drop the primary key since we already dropped the field
// that was the primary key.
db_add_primary_key('xmlsitemap_sitemap', array(
'smid',
));
}
_xmlsitemap_sitemap_rehash_all();
}