mollom_test.install 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. * @file
  4. * Installation functionality for Mollom testing module.
  5. */
  6. /**
  7. * Implements hook_schema().
  8. */
  9. function mollom_test_schema() {
  10. $schema['mollom_test'] = array(
  11. 'description' => 'Stores testing data for Mollom test form.',
  12. 'fields' => array(
  13. 'mid' => array(
  14. 'description' => 'Primary key: Unique mollom_test entity ID.',
  15. 'type' => 'serial',
  16. 'not null' => TRUE,
  17. ),
  18. 'title' => array(
  19. 'description' => 'Title of the post.',
  20. 'type' => 'varchar',
  21. 'length' => 255,
  22. 'not null' => TRUE,
  23. 'default' => '',
  24. ),
  25. 'body' => array(
  26. 'description' => 'Body of the post.',
  27. 'type' => 'text',
  28. 'not null' => TRUE,
  29. ),
  30. 'status' => array(
  31. 'description' => 'Publishing status.',
  32. 'type' => 'int',
  33. 'size' => 'tiny',
  34. 'not null' => TRUE,
  35. 'default' => 1,
  36. ),
  37. ),
  38. 'primary key' => array('mid'),
  39. );
  40. return $schema;
  41. }
  42. /**
  43. * Implements hook_uninstall().
  44. */
  45. function mollom_test_uninstall() {
  46. db_delete('variable')
  47. ->condition('name', db_like('mollom_test.') . '%', 'LIKE')
  48. ->execute();
  49. }