You are here

function flag_actions_install in Flag 5

Same name and namespace in other branches
  1. 6.2 flag_actions.install \flag_actions_install()
  2. 6 flag_actions.install \flag_actions_install()
  3. 7.2 flag_actions.install \flag_actions_install()

Implementation of hook_install().

File

./flag_actions.install, line 11
Flag actions install file.

Code

function flag_actions_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {flag_actions} (\n        aid int(11) NOT NULL auto_increment,\n        fid smallint(6) default NULL,\n        event varchar(255) default NULL,\n        threshold smallint(6) default NULL,\n        callback varchar(255) NOT NULL default '',\n        parameters longtext NOT NULL,\n        PRIMARY KEY (aid)\n      ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {flag_actions} (\n        aid serial,\n        fid smallint default NULL,\n        event varchar(255) default NULL,\n        threshold smallint default NULL,\n        callback varchar(255) NOT NULL default '',\n        parameters text NOT NULL,\n        PRIMARY KEY (aid)\n      )");
      break;
  }
}