function votingapi_update_4 in Voting API 6
Same name and namespace in other branches
- 5 votingapi.install \votingapi_update_4()
- 6.2 votingapi.install \votingapi_update_4()
Initial work to roll Voting Actions functionality into Voting API.
File
- ./
votingapi.install, line 65
Code
function votingapi_update_4() {
$ret = array();
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
$ret[] = update_sql("CREATE TABLE {votingapi_action_set} (\n vasid int(10) unsigned NOT NULL,\n parent int(10) unsigned NOT NULL,\n required int(8) NOT NULL default '0',\n mask varchar(8) default 'AND',\n content_type varchar(20) default NULL,\n name varchar(128) default NULL,\n enabled int default 1,\n source varchar(65) default NULL,\n weight int(10) NOT NULL default 0,\n PRIMARY KEY (vasid)\n ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;");
$ret[] = update_sql("CREATE TABLE {votingapi_action_condition} (\n vacid int(10) unsigned NOT NULL,\n vasid int(10) unsigned NOT NULL,\n weight int(10) NOT NULL default 0,\n value varchar(255),\n handler varchar(255) NOT NULL,\n PRIMARY KEY (vacid)\n ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;");
$ret[] = update_sql("CREATE TABLE {votingapi_action} (\n vasid int(10) unsigned NOT NULL,\n aid varchar(255) NOT NULL default '0'\n ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;");
break;
}
return $ret;
}