diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-02-03 17:30:13 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-02-03 17:30:13 +0000 |
commit | 607e9626d5af265b18e8319b156bb0fda3445cd4 (patch) | |
tree | ece98d14e826d14a711c9b572e3f43a428b9a365 /modules/simpletest/tests/field_test.install | |
parent | d4867346f578906751f8ea0bd799c3fc1bfcbf48 (diff) | |
download | brdo-607e9626d5af265b18e8319b156bb0fda3445cd4.tar.gz brdo-607e9626d5af265b18e8319b156bb0fda3445cd4.tar.bz2 |
- Patch #361683by Barry, Yves, Karen, Moshe Weitzman, David Strauss, floriant, chx, David Rothstein: initial field API patch. More work to be done, but ... oh my!
Diffstat (limited to 'modules/simpletest/tests/field_test.install')
-rw-r--r-- | modules/simpletest/tests/field_test.install | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/modules/simpletest/tests/field_test.install b/modules/simpletest/tests/field_test.install new file mode 100644 index 000000000..c706ebfe4 --- /dev/null +++ b/modules/simpletest/tests/field_test.install @@ -0,0 +1,75 @@ +<?php +// $Id$ + +/** + * Implementation of hook_schema().
+ */ +function field_test_schema() { + $schema['test_entity'] = array( + 'description' => 'The base table for test_entities.',
+ 'fields' => array(
+ 'ftid' => array(
+ 'description' => 'The primary identifier for a test_entity.',
+ 'type' => 'serial',
+ 'unsigned' => TRUE,
+ 'not null' => TRUE,
+ ),
+ 'ftvid' => array(
+ 'description' => 'The current {test_entity_revision}.ftvid version identifier.',
+ 'type' => 'int',
+ 'unsigned' => TRUE,
+ 'not null' => TRUE,
+ 'default' => 0,
+ ),
+ 'fttype' => array(
+ 'description' => 'The type of this test_entity.',
+ 'type' => 'varchar',
+ 'length' => 32,
+ 'not null' => TRUE,
+ 'default' => '',
+ ), + ), + 'unique keys' => array(
+ 'ftvid' => array('ftvid'),
+ ),
+ 'primary key' => array('ftid'), + );
+ $schema['test_entity_revision'] = array(
+ 'description' => 'Stores information about each saved version of a {test_entity}.',
+ 'fields' => array(
+ 'ftid' => array(
+ 'description' => 'The {test_entity} this version belongs to.',
+ 'type' => 'int',
+ 'unsigned' => TRUE,
+ 'not null' => TRUE,
+ 'default' => 0,
+ ),
+ 'ftvid' => array(
+ 'description' => 'The primary identifier for this version.',
+ 'type' => 'serial',
+ 'unsigned' => TRUE,
+ 'not null' => TRUE,
+ ),
+ ),
+ 'indexes' => array(
+ 'nid' => array('ftid'),
+ ),
+ 'primary key' => array('ftvid'),
+ ); + + return $schema; +} + +/** + * Implementation of hook_install(). + */ +function field_test_install() { + drupal_install_schema('field_test'); +} + +/** + * Implementation of hook_uninstall(). + */ +function field_test_uninstall() { + drupal_uninstall_schema('field_test'); +} |