You are here

drupal.install in Drupal 5

File

modules/drupal/drupal.install
View source
<?php

/**
 * Implementation of hook_install().
 */
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;
  }
}

/**
 * Implementation of hook_uninstall().
 */
function drupal_uninstall() {
  db_query('DROP TABLE {client}');
  db_query('DROP TABLE {client_system}');
  variable_del('drupal_authentication_service');
  variable_del('drupal_directory');
  variable_del('drupal_register');
  variable_del('drupal_server');
  variable_del('drupal_system');
  variable_del('drupal_statistics');
  variable_del('drupal_client_service');
  variable_del('drupal_default_da_server');
  variable_del('drupal_default_da_server_only');
}

Functions

Namesort descending Description
drupal_install Implementation of hook_install().
drupal_uninstall Implementation of hook_uninstall().