You are here

function uc_catalog_update_8 in Ubercart 5

File

uc_catalog/uc_catalog.install, line 184

Code

function uc_catalog_update_8() {
  $ret = array();
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      $ret[] = update_sql("UPDATE {url_alias} SET src = SUBSTRING_INDEX(src, '/', 2) WHERE src LIKE 'catalog/%%';");
      break;
    case 'pgsql':
      $ret[] = update_sql("UPDATE {url_alias} SET src = substring(src from '^catalog/\\d*') WHERE src LIKE 'catalog/%%';");
      break;
  }
  return $ret;
}