contact.install 1.94 KB
Newer Older
1
<?php
2
// $Id$
3

4
5
6
/**
 * Implementation of hook_install().
 */
7
function contact_install() {
8
9
  // Create tables.
  drupal_install_schema('contact');
10
}
11
12
13
14
15

/**
 * Implementation of hook_uninstall().
 */
function contact_uninstall() {
16
17
18
  // Remove tables.
  drupal_uninstall_schema('contact');

19
20
21
22
  variable_del('contact_default_status');
  variable_del('contact_form_information');
  variable_del('contact_hourly_threshold');
}
23
24
25
26
27
28

/**
 * Implementation of hook_schema().
 */
function contact_schema() {
  $schema['contact'] = array(
29
    'description' => 'Contact form category settings.',
30
    'fields' => array(
31
32
33
34
      'cid' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
35
        'description' => 'Primary Key: Unique category ID.',
36
37
38
39
40
41
      ),
      'category' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
42
        'description' => 'Category name.',
43
44
45
46
47
      ),
      'recipients' => array(
        'type' => 'text',
        'not null' => TRUE,
        'size' => 'big',
48
        'description' => 'Comma-separated list of recipient e-mail addresses.',
49
50
51
52
53
      ),
      'reply' => array(
        'type' => 'text',
        'not null' => TRUE,
        'size' => 'big',
54
        'description' => 'Text of the auto-reply message.',
55
56
57
58
59
60
      ),
      'weight' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'size' => 'tiny',
61
        'description' => "The category's weight.",
62
63
64
65
66
67
      ),
      'selected' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'size' => 'tiny',
68
        'description' => 'Flag to indicate whether or not category is selected by default. (1 = Yes, 0 = No)',
69
      ),
70
71
    ),
    'primary key' => array('cid'),
72
73
74
75
76
77
    'unique keys' => array(
      'category' => array('category'),
    ),
    'indexes' => array(
      'list' => array('weight', 'category'),
    ),
78
79
80
81
  );

  return $schema;
}