diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-02-26 18:31:29 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-02-26 18:31:29 +0000 |
commit | f6b166ff23faa3ab8a2f643394842710dbecfd3d (patch) | |
tree | 871c742fb8e120901ec941b9062109df36d9c593 /modules/simpletest/tests/module_test.install | |
parent | bc70eaeb8ddd78022ea6831ccb2e49b9cb653069 (diff) | |
download | brdo-f6b166ff23faa3ab8a2f643394842710dbecfd3d.tar.gz brdo-f6b166ff23faa3ab8a2f643394842710dbecfd3d.tar.bz2 |
- Patch #620298 by David_Rothstein: schema not available in hook_install().
Diffstat (limited to 'modules/simpletest/tests/module_test.install')
-rw-r--r-- | modules/simpletest/tests/module_test.install | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/modules/simpletest/tests/module_test.install b/modules/simpletest/tests/module_test.install new file mode 100644 index 000000000..5f8e76b70 --- /dev/null +++ b/modules/simpletest/tests/module_test.install @@ -0,0 +1,43 @@ +<?php +// $Id$ + +/** + * @file + * Install, update and uninstall functions for the module_test module. + */ + +/** + * Implements hook_schema(). + */ +function module_test_schema() { + $schema['module_test'] = array( + 'description' => 'Dummy table to test the behavior of hook_schema() during module installation.', + 'fields' => array( + 'data' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + 'description' => 'An example data column for the module.', + ), + ), + ); + return $schema; +} + +/** + * Implements hook_install(). + */ +function module_test_install() { + $record = array('data' => 'Data inserted in hook_install()'); + drupal_write_record('module_test', $record); +} + +/** + * Implements hook_enable(). + */ +function module_test_enable() { + $record = array('data' => 'Data inserted in hook_enable()'); + drupal_write_record('module_test', $record); +} + |