You are here

mass_contact.install in Mass Contact 5

File

mass_contact.install
View source
<?php

/**
 * Implementation of hook_install().
 */
function mass_contact_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {mass_contact} (\n        cid int unsigned NOT NULL auto_increment,\n        category varchar(255) NOT NULL default '',\n        recipients longtext NOT NULL,\n        reply longtext NOT NULL,\n        weight tinyint NOT NULL default '0',\n        selected tinyint NOT NULL default '0',\n        PRIMARY KEY (cid),\n        UNIQUE KEY category (category)\n      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {mass_contact} (\n        cid serial CHECK (cid >= 0),\n        category varchar(255) NOT NULL default '',\n        recipients text NOT NULL default '',\n        reply text NOT NULL default '',\n        weight smallint NOT NULL default '0',\n        selected smallint NOT NULL default '0',\n        PRIMARY KEY (cid),\n        UNIQUE (category)\n      )");
      break;
  }
  drupal_set_message(t('mass_contact table created.'));
}

/**
 * Implementation of hook_uninstall().
 */
function mass_contact_uninstall() {
  db_query('DROP TABLE {mass_contact}');

  //  db_query('DELETE FROM node_type WHERE type = "mass_contact"');
}

Functions

Namesort descending Description
mass_contact_install Implementation of hook_install().
mass_contact_uninstall Implementation of hook_uninstall().