You are here

function drupal_install in Drupal 5

Implementation of hook_install().

File

modules/drupal/drupal.install, line 6

Code

function drupal_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {client} (\n        cid int unsigned NOT NULL auto_increment,\n        link varchar(255) NOT NULL default '',\n        name varchar(128) NOT NULL default '',\n        mail varchar(128) NOT NULL default '',\n        slogan longtext NOT NULL,\n        mission longtext NOT NULL,\n        users int NOT NULL default '0',\n        nodes int NOT NULL default '0',\n        version varchar(35) NOT NULL default'',\n        created int NOT NULL default '0',\n        changed int NOT NULL default '0',\n        PRIMARY KEY (cid)\n      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
      db_query("CREATE TABLE {client_system} (\n        cid int NOT NULL default '0',\n        name varchar(255) NOT NULL default '',\n        type varchar(255) NOT NULL default '',\n        PRIMARY KEY (cid,name)\n      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {client} (\n        cid serial CHECK (cid >= 0),\n        link varchar(255) NOT NULL default '',\n        name varchar(128) NOT NULL default '',\n        mail varchar(128) NOT NULL default '',\n        slogan text NOT NULL,\n        mission text NOT NULL,\n        users int NOT NULL default '0',\n        nodes int NOT NULL default '0',\n        version varchar(35) NOT NULL default'',\n        created int NOT NULL default '0',\n        changed int NOT NULL default '0',\n        PRIMARY KEY (cid)\n      )");
      db_query("CREATE TABLE {client_system} (\n        cid int NOT NULL default '0',\n        name varchar(255) NOT NULL default '',\n        type varchar(255) NOT NULL default '',\n        PRIMARY KEY (cid,name)\n      )");
      break;
  }
}