You are here

function fieldgroup_update_1 in Content Construction Kit (CCK) 5

Same name and namespace in other branches
  1. 6.3 modules/fieldgroup/fieldgroup.install \fieldgroup_update_1()
  2. 6.2 modules/fieldgroup/fieldgroup.install \fieldgroup_update_1()

rename groups form "group-*" to "group_*"

File

./fieldgroup.install, line 45

Code

function fieldgroup_update_1() {
  $ret = array();
  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;
}