You are here

menu_per_role.install in Menu Per Role 5

Same filename and directory in other branches
  1. 8 menu_per_role.install
  2. 6 menu_per_role.install
  3. 7 menu_per_role.install

File

menu_per_role.install
View source
<?php

function menu_per_role_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysqli':
    case 'mysql':
      db_query("CREATE TABLE if not exists {menu_per_role} (\n        mid int(10) unsigned,\n        rid int(10) unsigned,\n        PRIMARY KEY(mid, rid)\n      ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {menu_per_role} (\n        mid integer,\n        rid integer,\n        PRIMARY KEY(mid, rid)\n      )");
    default:
      break;
  }
}
function menu_per_role_uninstall() {
  db_query("DROP TABLE {menu_per_role}");
}