You are here

function webform_update_5 in Webform 6.2

Same name and namespace in other branches
  1. 5.2 webform.install \webform_update_5()
  2. 5 webform.install \webform_update_5()

Update MySQL sequence name to be cross-database compatible.

File

./webform.install, line 413
Webform module install/schema hooks.

Code

function webform_update_5() {
  $ret = array();
  switch ($GLOBALS['db_type']) {
    case 'mysqli':
    case 'mysql':
      db_query('LOCK TABLES {sequences} WRITE');
      $ret[] = update_sql(sprintf("UPDATE {sequences} SET name = '%s' WHERE name = '%s'", db_prefix_tables('{webform_submissions}_sid'), db_prefix_tables('{webform_submissions}_id')));
      db_query('UNLOCK TABLES');
      break;
  }
  return $ret;
}