function workflow_access_install in Workflow 5
Same name and namespace in other branches
- 5.2 workflow_access.install \workflow_access_install()
- 6.2 workflow_access/workflow_access.install \workflow_access_install()
- 6 workflow_access/workflow_access.install \workflow_access_install()
- 7 workflow_access/workflow_access.install \workflow_access_install()
Implementation of hook_install().
File
- ./
workflow_access.install, line 6
Code
function workflow_access_install() {
$result = array();
switch ($GLOBALS['db_type']) {
case 'mysqli':
case 'mysql':
$result[] = db_query(<<<QUERY
CREATE TABLE {workflow_access} (
sid int(10) NOT NULL default 0,
rid int(10) NOT NULL default 0,
grant_view tinyint(1) unsigned NOT NULL default 0,
grant_update tinyint(1) unsigned NOT NULL default 0,
grant_delete tinyint(1) unsigned NOT NULL default 0,
KEY sid (sid),
KEY rid (rid)
) /*!40100 DEFAULT CHARACTER SET utf8 */;
QUERY
);
break;
case 'pgsql':
$result[] = db_query(<<<QUERY
CREATE TABLE {workflow_access} (
sid SERIAL,
rid integer NOT NULL default 0,
grant_view int_unsigned NOT NULL default 0,
grant_update int_unsigned NOT NULL default 0,
grant_delete int_unsigned NOT NULL default 0
);
QUERY
);
$result[] = db_query(<<<QUERY
CREATE INDEX {workflow_access}_rid_idx ON {workflow_access}(rid);
QUERY
);
}
}