/[drupal]/contributions/modules/contact_forms/contact_forms.install
ViewVC logotype

Diff of /contributions/modules/contact_forms/contact_forms.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.8, Sun Nov 8 12:32:28 2009 UTC revision 1.9, Mon Nov 9 06:46:37 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: contact_forms.install,v 1.7 2009/11/08 08:19:18 gpdinoz Exp $  // $Id: contact_forms.install,v 1.8 2009/11/08 12:32:28 gpdinoz Exp $
3    
4  /**  /**
5   * Implementation of hook_install().   * Implementation of hook_install().
6   */   */
7  function contact_forms_install() {  function contact_forms_install() {
8    //Alter the contact table to add an info field for each category    //Alter the contact table to add an info field for each category
9    $sql = 'ALTER TABLE {contact} ADD page_info TEXT NULL';     $ret = array();
10    db_query($sql);    db_add_field($ret, 'contact', 'page_info', array('type' => 'text', 'size' => 'big', 'not null' => FALSE));
11    
12    watchdog ('Contact Forms', 'contact_forms module installed');    watchdog ('Contact Forms', 'contact_forms module installed');
13    drupal_set_message(t("Contact Forms module has been enabled. You can edit it's settings at !link",    drupal_set_message(t("Contact Forms module has been enabled. You can edit it's settings at !link",
# Line 26  function contact_forms_uninstall() { Line 26  function contact_forms_uninstall() {
26    variable_del('contactform_redirect');    variable_del('contactform_redirect');
27    
28    //remove category information field    //remove category information field
29    $sql = 'ALTER TABLE {contact} DROP page_info';    $ret = array();
30    db_query($sql);    db_drop_field($ret, 'contact', 'page_info');
31    
32    
33    // clear the cache tables    // clear the cache tables
34    cache_clear_all(null, 'cache');    cache_clear_all(null, 'cache');
# Line 43  function contact_forms_uninstall() { Line 44  function contact_forms_uninstall() {
44  */  */
45  function contact_forms_update_6100() {  function contact_forms_update_6100() {
46    $ret = array();    $ret = array();
47    db_add_field($ret, 'contact', 'page_info', array('type' => 'text', 'not null' => FALSE));    db_add_field($ret, 'contact', 'page_info', array('type' => 'text', 'size' => 'big', 'not null' => FALSE));
48    return $ret;    return $ret;
49  }  }

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.2