From f6b166ff23faa3ab8a2f643394842710dbecfd3d Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 26 Feb 2010 18:31:29 +0000 Subject: - Patch #620298 by David_Rothstein: schema not available in hook_install(). --- modules/simpletest/tests/module_test.install | 43 ++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 modules/simpletest/tests/module_test.install (limited to 'modules/simpletest/tests/module_test.install') 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 @@ + '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); +} + -- cgit v1.2.3