You are here

function feedback_install in Feedback 5.2

Same name and namespace in other branches
  1. 5 feedback.install \feedback_install()
  2. 6.2 feedback.install \feedback_install()

Implementation of hook_install().

File

./feedback.install, line 6

Code

function feedback_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {feedback} (\n        fid int unsigned NOT NULL default '0',\n        uid int unsigned NOT NULL default '0',\n        status tinyint unsigned NOT NULL default '0',\n        message longtext NOT NULL,\n        location text NOT NULL,\n        location_masked text NOT NULL,\n        url text NOT NULL,\n        timestamp int NOT NULL,\n        useragent varchar(255) NOT NULL,\n        PRIMARY KEY (fid),\n        KEY location (location(32)),\n        KEY location_masked (location_masked(32))\n      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {feedback} (\n        fid int_unsigned NOT NULL default '0',\n        uid int_unsigned NOT NULL default '0',\n        status smallint NOT NULL default '0',\n        message text NOT NULL,\n        location text NOT NULL,\n        location_masked text NOT NULL,\n        url text NOT NULL,\n        timestamp int NOT NULL,\n        useragent varchar(255) NOT NULL,\n        PRIMARY KEY (fid)\n      )");
      db_query("CREATE INDEX {feedback}_fid_idx ON {feedback} (fid)");
      db_query("CREATE INDEX {feedback}_location_idx ON {feedback} (location)");
      db_query("CREATE INDEX {feedback}_location_masked_idx ON {feedback} (location_masked)");
      break;
  }
}