contact.install

  1. 7.x drupal-7.x/modules/contact/contact.install
  2. 6.x drupal-6.x/modules/contact/contact.install

File

drupal-6.x/modules/contact/contact.install
View source
  1. <?php
  2. /**
  3. * Implementation of hook_install().
  4. */
  5. function contact_install() {
  6. // Create tables.
  7. drupal_install_schema('contact');
  8. }
  9. /**
  10. * Implementation of hook_uninstall().
  11. */
  12. function contact_uninstall() {
  13. // Remove tables.
  14. drupal_uninstall_schema('contact');
  15. variable_del('contact_default_status');
  16. variable_del('contact_form_information');
  17. variable_del('contact_hourly_threshold');
  18. }
  19. /**
  20. * Implementation of hook_schema().
  21. */
  22. function contact_schema() {
  23. $schema['contact'] = array(
  24. 'description' => 'Contact form category settings.',
  25. 'fields' => array(
  26. 'cid' => array(
  27. 'type' => 'serial',
  28. 'unsigned' => TRUE,
  29. 'not null' => TRUE,
  30. 'description' => 'Primary Key: Unique category ID.',
  31. ),
  32. 'category' => array(
  33. 'type' => 'varchar',
  34. 'length' => 255,
  35. 'not null' => TRUE,
  36. 'default' => '',
  37. 'description' => 'Category name.',
  38. ),
  39. 'recipients' => array(
  40. 'type' => 'text',
  41. 'not null' => TRUE,
  42. 'size' => 'big',
  43. 'description' => 'Comma-separated list of recipient e-mail addresses.',
  44. ),
  45. 'reply' => array(
  46. 'type' => 'text',
  47. 'not null' => TRUE,
  48. 'size' => 'big',
  49. 'description' => 'Text of the auto-reply message.',
  50. ),
  51. 'weight' => array(
  52. 'type' => 'int',
  53. 'not null' => TRUE,
  54. 'default' => 0,
  55. 'size' => 'tiny',
  56. 'description' => "The category's weight.",
  57. ),
  58. 'selected' => array(
  59. 'type' => 'int',
  60. 'not null' => TRUE,
  61. 'default' => 0,
  62. 'size' => 'tiny',
  63. 'description' => 'Flag to indicate whether or not category is selected by default. (1 = Yes, 0 = No)',
  64. ),
  65. ),
  66. 'primary key' => array('cid'),
  67. 'unique keys' => array(
  68. 'category' => array('category'),
  69. ),
  70. 'indexes' => array(
  71. 'list' => array('weight', 'category'),
  72. ),
  73. );
  74. return $schema;
  75. }