diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-11-20 23:29:28 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-11-20 23:29:28 +0000 |
commit | 34119ba98b9e7b412ed7efdcf7b9e9b704f790c7 (patch) | |
tree | 2df5e294692237e93ffcc3e142566fed5325950a /modules/field/tests/field_test.install | |
parent | b14349889e9e51fb44934694030e95306918e3bd (diff) | |
download | brdo-34119ba98b9e7b412ed7efdcf7b9e9b704f790c7.tar.gz brdo-34119ba98b9e7b412ed7efdcf7b9e9b704f790c7.tar.bz2 |
#638356 by yched: Reorganize and re-locate field test modules.
Diffstat (limited to 'modules/field/tests/field_test.install')
-rw-r--r-- | modules/field/tests/field_test.install | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/modules/field/tests/field_test.install b/modules/field/tests/field_test.install new file mode 100644 index 000000000..2bb1701bf --- /dev/null +++ b/modules/field/tests/field_test.install @@ -0,0 +1,77 @@ +<?php +// $Id$ + +/** + * @file + * Install, update and uninstall functions for the field_test module. + */ + +/** + * Implement hook_install(). + */ +function field_test_install() { + // hook_entity_info_alter() needs to be executed as last. + db_update('system') + ->fields(array('weight' => 1)) + ->condition('name', 'field_test') + ->execute(); +} + +/** + * Implement 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; +} |