You are here

function fivestar_comment_install in Fivestar 5

Same name and namespace in other branches
  1. 6.2 fivestar_comment.install \fivestar_comment_install()
  2. 6 fivestar_comment.install \fivestar_comment_install()

@file Installation file for Fivestar Comment module.

File

./fivestar_comment.install, line 8
Installation file for Fivestar Comment module.

Code

function fivestar_comment_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {fivestar_comment} (\n        cid int NOT NULL default '0',\n        vote_id int(10) NOT NULL default '0',\n        value tinyint unsigned NOT NULL default '0',\n        PRIMARY KEY (cid),\n        INDEX (vote_id)\n      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {fivestar_comment} (\n        cid integer NOT NULL default '0',\n        vote_id integer NOT NULL default '0',\n        value smallint NOT NULL default '0',\n        PRIMARY KEY (cid)\n      )");
      db_query("CREATE INDEX {fivestar_comment}_vote_id_idx ON {fivestar_comment} (vote_id)");
      break;
  }
}