You are here

function simple_access_update_5 in Simple Access 5.2

Same name and namespace in other branches
  1. 6.2 simple_access.install \simple_access_update_5()

File

./simple_access.install, line 184
Simple Access Installation file

Code

function simple_access_update_5() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {simple_access_owner} (\n        nid int(10) unsigned NOT NULL default '0',\n        `view` tinyint unsigned NOT NULL default '0',\n        `update` tinyint unsigned NOT NULL default '0',\n        `delete` tinyint unsigned NOT NULL default '0',\n        PRIMARY KEY  (nid)\n      ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {simple_access_owner} (\n        nid integer unsigned NOT NULL default '0',\n        view integer unsigned NOT NULL default '0',\n        update integer unsigned NOT NULL default '0',\n        delete integer unsigned NOT NULL default '0',\n      );");
      break;
  }
  $ret[] = update_sql('INSERT INTO {simple_access_owner} SELECT nid, 1, 1, 1 FROM {node};');
  return $ret;
}