function mass_contact_install in Mass Contact 5
Same name and namespace in other branches
- 8 mass_contact.install \mass_contact_install()
- 5.2 mass_contact.install \mass_contact_install()
- 6 mass_contact.install \mass_contact_install()
- 7 mass_contact.install \mass_contact_install()
Implementation of hook_install().
File
- ./
mass_contact.install, line 6
Code
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.'));
}