function fieldgroup_update_1 in Content Construction Kit (CCK) 6.3
Same name and namespace in other branches
- 5 fieldgroup.install \fieldgroup_update_1()
- 6.2 modules/fieldgroup/fieldgroup.install \fieldgroup_update_1()
rename groups form "group-*" to "group_*"
File
- modules/
fieldgroup/ fieldgroup.install, line 77 - Implementation of hook_install().
Code
function fieldgroup_update_1() {
$ret = array();
if (!db_table_exists('node_group')) {
return $ret;
}
switch ($GLOBALS['db_type']) {
case 'pgsql':
$ret[] = update_sql("UPDATE {node_group} SET group_name = 'group_'||SUBSTRING(group_name FROM 7)");
$ret[] = update_sql("UPDATE {node_group_fields} SET group_name = 'group_'||SUBSTRING(group_name FROM 7)");
break;
case 'mysql':
case 'mysqli':
$ret[] = update_sql("UPDATE {node_group} SET group_name = CONCAT('group_', SUBSTRING(group_name FROM 7))");
$ret[] = update_sql("UPDATE {node_group_fields} SET group_name = CONCAT('group_', SUBSTRING(group_name FROM 7))");
break;
}
return $ret;
}