You are here

domain_source.install in Domain Access 5

Install file for the Domain Source module

File

domain_source/domain_source.install
View source
<?php

/**
* @file
* Install file for the Domain Source module
*/

/**
 * Implement hook_install()
 *
 * @ingroup drupal
 */
function domain_source_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysqli':
    case 'mysql':
      db_query("CREATE TABLE IF NOT EXISTS {domain_source} (\n       nid int(11) NOT NULL default 0,\n       domain_id int(11) NOT NULL default 0,\n       PRIMARY KEY (nid)\n      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {domain_source} (\n       nid integer NOT NULL default 0,\n       domain_id integer NOT NULL default 0,\n       PRIMARY KEY (nid)\n      )");
      break;
  }
}

/**
 * Implement hook_uninstall()
 */
function domain_source_uninstall() {
  db_query("DROP TABLE {domain_source}");
}

Functions