workflow_access.install in Workflow 5
File
workflow_access.install
View source
<?php
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
);
}
}
function workflow_access_uninstall() {
db_query('DROP TABLE {workflow_access}');
node_access_rebuild();
}