Code coverage for /20080809/modules/contact/contact.install

Line #Times calledCode
1
<?php
2
// $Id: contact.install,v 1.10 2007/12/18 12:59:21 dries Exp $
3
4
/**
5
 * Implementation of hook_install().
6
 */
72
function contact_install() {
8
  // Create tables.
92
  drupal_install_schema('contact');
102
}
11
12
/**
13
 * Implementation of hook_uninstall().
14
 */
152
function contact_uninstall() {
16
  // Remove tables.
170
  drupal_uninstall_schema('contact');
18
190
  variable_del('contact_default_status');
200
  variable_del('contact_form_information');
210
  variable_del('contact_hourly_threshold');
220
}
23
24
/**
25
 * Implementation of hook_schema().
26
 */
272
function contact_schema() {
282
  $schema['contact'] = array(
292
    'description' => t('Contact form category settings.'),
30
    'fields' => array(
31
      'cid' => array(
322
        'type' => 'serial',
332
        'unsigned' => TRUE,
342
        'not null' => TRUE,
352
        'description' => t('Primary Key: Unique category ID.'),
362
      ),
37
      'category' => array(
382
        'type' => 'varchar',
392
        'length' => 255,
402
        'not null' => TRUE,
412
        'default' => '',
422
        'description' => t('Category name.'),
432
      ),
44
      'recipients' => array(
452
        'type' => 'text',
462
        'not null' => TRUE,
472
        'size' => 'big',
482
        'description' => t('Comma-separated list of recipient e-mail
addresses.'),
492
      ),
50
      'reply' => array(
512
        'type' => 'text',
522
        'not null' => TRUE,
532
        'size' => 'big',
542
        'description' => t('Text of the auto-reply message.'),
552
      ),
56
      'weight' => array(
572
        'type' => 'int',
582
        'not null' => TRUE,
592
        'default' => 0,
602
        'size' => 'tiny',
612
        'description' => t("The category's weight."),
622
      ),
63
      'selected' => array(
642
        'type' => 'int',
652
        'not null' => TRUE,
662
        'default' => 0,
672
        'size' => 'tiny',
682
        'description' => t('Flag to indicate whether or not category is
selected by default. (1 = Yes, 0 = No)'),
692
      ),
702
    ),
712
    'primary key' => array('cid'),
72
    'unique keys' => array(
732
      'category' => array('category'),
742
    ),
75
    'indexes' => array(
762
      'list' => array('weight', 'category'),
772
    ),
78
  );
79
802
  return $schema;
810
}
822