module_test.install 930 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * @file
  4. * Install, update and uninstall functions for the module_test module.
  5. */
  6. /**
  7. * Implements hook_schema().
  8. */
  9. function module_test_schema() {
  10. $schema['module_test'] = array(
  11. 'description' => 'Dummy table to test the behavior of hook_schema() during module installation.',
  12. 'fields' => array(
  13. 'data' => array(
  14. 'type' => 'varchar',
  15. 'length' => 255,
  16. 'not null' => TRUE,
  17. 'default' => '',
  18. 'description' => 'An example data column for the module.',
  19. ),
  20. ),
  21. );
  22. return $schema;
  23. }
  24. /**
  25. * Implements hook_install().
  26. */
  27. function module_test_install() {
  28. $record = array('data' => 'Data inserted in hook_install()');
  29. drupal_write_record('module_test', $record);
  30. }
  31. /**
  32. * Implements hook_enable().
  33. */
  34. function module_test_enable() {
  35. $record = array('data' => 'Data inserted in hook_enable()');
  36. drupal_write_record('module_test', $record);
  37. }