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

Diff of /contributions/modules/premium/premium.install

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

revision 1.4, Sun Jul 13 17:58:27 2008 UTC revision 1.5, Tue Jan 13 19:16:42 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: premium.install,v 1.3 2008/07/13 17:54:29 vauxia Exp $  // $Id: premium.install,v 1.4 2008/07/13 17:58:27 vauxia Exp $
3    
4    /**
5     * Implementation of hook_install().
6     */
7  function premium_install() {  function premium_install() {
8    switch ($GLOBALS['db_type']) {    drupal_install_schema('premium');
     case 'mysql':  
     case 'mysqli':  
       db_query('CREATE TABLE {premium} (  
         nid               INT NOT NULL,  
         start_ts          INT,  
         end_ts            INT,  
         PRIMARY KEY(nid)  
       ) /*!40100 DEFAULT CHARACTER SET utf8 */;');  
       break;  
     case 'pgsql':  
       db_query('CREATE TABLE {premium} (  
         nid               INT NOT NULL,  
         start_ts          INT,  
         end_ts            INT,  
         PRIMARY KEY(nid)  
       )');  
       break;  
   }  
9  }  }
10    
11    /**
12     * Implementation of hook_schema().
13     */
14    function premium_schema() {
15      $schema['premium'] = array(
16        'fields' => array(
17          'nid' => array(
18            'type' => 'int',
19            'not null' => TRUE,
20            'disp-width' => '11',
21          ),
22          'start_ts' => array(
23            'type' => 'int',
24            'not null' => FALSE,
25            'disp-width' => '11',
26          ),
27          'end_ts' => array(
28            'type' => 'int',
29            'not null' => FALSE,
30            'disp-width' => '11',
31          ),
32        ),
33        'primary key' => array('nid'),
34      );
35      return $schema;
36    }
37    
38    /**
39     * Implementation of hook_uninstall().
40     */
41  function premium_uninstall() {  function premium_uninstall() {
42    db_query('DROP TABLE {premium}');    drupal_uninstall_schema('premium');
43    variable_del('premium_mode');    variable_del('premium_mode');
44    variable_del('premium_time_count');    variable_del('premium_time_count');
45    variable_del('premium_time_unit');    variable_del('premium_time_unit');

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.2