You are here

function spam_update_5305 in Spam 5.3

Add uid to spam_filters_errors table. Add form to spam_filters_errors table. Update id_type key to not be unique, id can be 0.

File

./spam.install, line 484

Code

function spam_update_5305() {

  // Update contontained in _5300 if updating from 5.x-1.x spam module.
  if (spam_skip_update()) {
    return array();
  }
  $ret = array();
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
    default:
      $ret[] = update_sql("ALTER TABLE {spam_filters_errors} ADD uid INT(11) UNSIGNED NOT NULL DEFAULT '0'");
      $ret[] = update_sql('ALTER TABLE {spam_filters_errors} ADD form TEXT NOT NULL');
      $ret[] = update_sql('ALTER TABLE {spam_filters_errors} DROP KEY content_id_content_type');
      $ret[] = update_sql('ALTER TABLE {spam_filters_errors} ADD KEY id_type (content_id,content_type)');
      break;
  }
  return $ret;
}