node_access_example_install

Versions
5 – 7
node_access_example_install()

Implementation of hook_install().

Code

developer/examples/node_access_example.install, line 6

<?php
function node_access_example_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("
          CREATE TABLE {node_access_example} (
            nid int(10) unsigned NOT NULL default '0' PRIMARY KEY,
            private int,
            KEY node_example_nid (nid)
          ) /*!40100 DEFAULT CHARACTER SET utf8 */;
      ");
      break;
    case 'pgsql':
      db_query("
          CREATE TABLE {node_access_example} (
            nid int NOT NULL default '0',
            private int,
            PRIMARY KEY (nid));
      ");
      break;
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.