You are here

function modr8_update_1000 in modr8 5

Same name and namespace in other branches
  1. 6 modr8.install \modr8_update_1000()

Update table definitions.

File

./modr8.install, line 55

Code

function modr8_update_1000() {
  $ret = array();
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      $ret[] = update_sql("CREATE TABLE {modr8_log} (\n        modid int NOT NULL auto_increment,\n        nid int unsigned NOT NULL default '0',\n        uid int NOT NULL default '0',\n        author_uid int NOT NULL default '0',\n        action varchar(16) NOT NULL default '',\n        title varchar(128) NOT NULL default '',\n        message longtext NOT NULL,\n        teaser longtext NOT NULL,\n        timestamp int NOT NULL default '0',\n        PRIMARY KEY (modid),\n        KEY nid_time (nid, modid),\n        KEY action (action)\n      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
      break;
    case 'pgsql':
      $ret[] = update_sql("CREATE TABLE {modr8_log} (\n        modid serial,\n        nid int_unsigned NOT NULL default '0',\n        uid int NOT NULL default '0',\n        author_uid int NOT NULL default '0',\n        action varchar(16) NOT NULL default '',\n        title varchar(128) NOT NULL default '',\n        message text NOT NULL,\n        teaser text NOT NULL,\n        timestamp int NOT NULL default '0',\n        PRIMARY KEY (modid)\n      )");
      $ret[] = update_sql("CREATE INDEX {modr8_log}_nid_time ON {modr8_log} (nid, modid)");
      $ret[] = update_sql("CREATE INDEX {modr8_log}_act_idx ON {modr8_log} (action)");
      break;
  }
  return $ret;
}