comparison modules/contact/contact.install @ 1:c1f4ac30525a 6.0

Drupal 6.0
author Franck Deroche <webmaster@defr.org>
date Tue, 23 Dec 2008 14:28:28 +0100
parents
children 3edae6ecd6c6
comparison
equal deleted inserted replaced
0:5a113a1c4740 1:c1f4ac30525a
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 */
7 function contact_install() {
8 // Create tables.
9 drupal_install_schema('contact');
10 }
11
12 /**
13 * Implementation of hook_uninstall().
14 */
15 function contact_uninstall() {
16 // Remove tables.
17 drupal_uninstall_schema('contact');
18
19 variable_del('contact_default_status');
20 variable_del('contact_form_information');
21 variable_del('contact_hourly_threshold');
22 }
23
24 /**
25 * Implementation of hook_schema().
26 */
27 function contact_schema() {
28 $schema['contact'] = array(
29 'description' => t('Contact form category settings.'),
30 'fields' => array(
31 'cid' => array(
32 'type' => 'serial',
33 'unsigned' => TRUE,
34 'not null' => TRUE,
35 'description' => t('Primary Key: Unique category ID.'),
36 ),
37 'category' => array(
38 'type' => 'varchar',
39 'length' => 255,
40 'not null' => TRUE,
41 'default' => '',
42 'description' => t('Category name.'),
43 ),
44 'recipients' => array(
45 'type' => 'text',
46 'not null' => TRUE,
47 'size' => 'big',
48 'description' => t('Comma-separated list of recipient e-mail addresses.'),
49 ),
50 'reply' => array(
51 'type' => 'text',
52 'not null' => TRUE,
53 'size' => 'big',
54 'description' => t('Text of the auto-reply message.'),
55 ),
56 'weight' => array(
57 'type' => 'int',
58 'not null' => TRUE,
59 'default' => 0,
60 'size' => 'tiny',
61 'description' => t("The category's weight."),
62 ),
63 'selected' => array(
64 'type' => 'int',
65 'not null' => TRUE,
66 'default' => 0,
67 'size' => 'tiny',
68 'description' => t('Flag to indicate whether or not category is selected by default. (1 = Yes, 0 = No)'),
69 ),
70 ),
71 'primary key' => array('cid'),
72 'unique keys' => array(
73 'category' => array('category'),
74 ),
75 'indexes' => array(
76 'list' => array('weight', 'category'),
77 ),
78 );
79
80 return $schema;
81 }