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

Diff of /contributions/modules/stock/stock.install

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

revision 1.1.4.2, Wed May 9 23:37:32 2007 UTC revision 1.1.4.3, Tue Mar 18 22:58:39 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: stock.install,v 1.1.4.1 2007/02/05 15:30:54 oadaeh Exp $  // $Id: stock.install,v 1.1.4.2 2007/05/09 23:37:32 kbahey Exp $
3    
4  /**  /**
5   * Implementation of hook_install()   * Implementation of hook_install()
6   *   *
7   * This will automatically install the MySQL database tables for Stock module.   * This will automatically install the MySQL & PostgreSQL database tables for Stock module.
  *  
  * Todo: Create pgsql query.  
8   *   *
9   */   */
10  function stock_install() {  function stock_install() {
# Line 22  function stock_install() { Line 20  function stock_install() {
20        break;        break;
21    
22      case 'pgsql':      case 'pgsql':
23          $query = db_query(
24            "CREATE TABLE stock (
25            uid INTEGER NOT NULL DEFAULT 0,
26            symbols VARCHAR(255) NOT NULL DEFAULT '',
27            CONSTRAINT stock_pk PRIMARY KEY (uid)
28            );");
29        break;        break;
30    }    }
31  }  }
# Line 30  function stock_install() { Line 34  function stock_install() {
34  /**  /**
35   * Implementation of hook_uninstall()   * Implementation of hook_uninstall()
36   *   *
37   * This will automatically remove the MySQL database tables for Stock module.   * This will automatically remove the MySQL & PostgreSQL database tables for Stock module.
38   *   *
  * Todo: Create pgsql query.  
39   */   */
40  function stock_uninstall() {  function stock_uninstall() {
41    switch ($GLOBALS['db_type']) {    switch ($GLOBALS['db_type']) {
# Line 45  function stock_uninstall() { Line 48  function stock_uninstall() {
48        break;        break;
49    
50      case 'pgsql':      case 'pgsql':
51          db_query('DROP TABLE stock CASCADE');
52          variable_del('stock_block_title');
53          variable_del('stock_description');
54          variable_del('stock_overview_title');
55        break;        break;
56    }    }
57  }  }

Legend:
Removed from v.1.1.4.2  
changed lines
  Added in v.1.1.4.3

  ViewVC Help
Powered by ViewVC 1.1.2