diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-09-27 12:52:55 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-09-27 12:52:55 +0000 |
commit | 803b8b3940257330e3945e243d559718c85cc481 (patch) | |
tree | ba082ac801da31f06385ead5bea4338eb4ccc4c0 /modules/field/field.install | |
parent | 252996066042b290bff9bebba8f8256cab62a999 (diff) | |
download | brdo-803b8b3940257330e3945e243d559718c85cc481.tar.gz brdo-803b8b3940257330e3945e243d559718c85cc481.tar.bz2 |
- Patch #443422 by yched, bjaspan | chx, merlinofchaos, Scott Reynolds, plach, profix898, mattyoung: added support for pluggable 'per field' storage engine. Comes with documentation and tests.
The Field Attach API uses the Field Storage API to perform all "database access". Each Field Storage API hook function defines a primitive database operation such as read, write, or delete. The default field storage module, field_sql_storage.module, uses the local SQL database to implement these operations, but alternative field storage backends can choose to represent the data in SQL differently or use a completely different storage mechanism such as a cloud-based database.
Diffstat (limited to 'modules/field/field.install')
-rw-r--r-- | modules/field/field.install | 70 |
1 files changed, 48 insertions, 22 deletions
diff --git a/modules/field/field.install b/modules/field/field.install index ba3db1df5..c112ef1b6 100644 --- a/modules/field/field.install +++ b/modules/field/field.install @@ -28,41 +28,63 @@ function field_schema() { 'type' => 'varchar', 'length' => 128, 'not null' => TRUE, - 'description' => 'The type of this field, coming from a field module', + 'description' => 'The type of this field.', ), - 'locked' => array( + 'module' => array( + 'type' => 'varchar', + 'length' => 128, + 'not null' => TRUE, + 'default' => '', + 'description' => 'The module that implements the field type.', + ), + 'active' => array( 'type' => 'int', 'size' => 'tiny', 'not null' => TRUE, 'default' => 0, - 'description' => '@TODO', + 'description' => 'Boolean indicating whether the module that implements the field type is enabled.', ), - 'data' => array( - 'type' => 'text', - 'size' => 'medium', + 'storage_type' => array( + 'type' => 'varchar', + 'length' => 128, 'not null' => TRUE, - 'serialize' => TRUE, - 'description' => 'Field specific settings, for example maximum length', + 'description' => 'The storage backend for the field.', ), - 'module' => array( + 'storage_module' => array( 'type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => '', + 'description' => 'The module that implements the storage backend.', ), - 'cardinality' => array( + 'storage_active' => array( 'type' => 'int', 'size' => 'tiny', 'not null' => TRUE, 'default' => 0, + 'description' => 'Boolean indicating whether the module that implements the storage backend is enabled.', ), - 'translatable' => array( + 'locked' => array( 'type' => 'int', 'size' => 'tiny', 'not null' => TRUE, 'default' => 0, + 'description' => '@TODO', ), - 'active' => array( + 'data' => array( + 'type' => 'text', + 'size' => 'medium', + 'not null' => TRUE, + 'serialize' => TRUE, + 'description' => 'Serialized data containing the field properties that do not warrant a dedicated column.', + ), + 'cardinality' => array( + 'type' => 'int', + 'size' => 'tiny', + 'not null' => TRUE, + 'default' => 0, + ), + 'translatable' => array( 'type' => 'int', 'size' => 'tiny', 'not null' => TRUE, @@ -77,14 +99,17 @@ function field_schema() { ), 'primary key' => array('id'), 'indexes' => array( - // used by field_delete_field() among others 'field_name' => array('field_name'), - // used by field_read_fields() - 'active_deleted' => array('active', 'deleted'), - // used by field_modules_disabled() + // Used by field_read_fields(). + 'active' => array('active'), + 'storage_active' => array('storage_active'), + 'deleted' => array('deleted'), + // Used by field_modules_disabled(). 'module' => array('module'), - // used by field_associate_fields() + 'storage_module' => array('storage_module'), + // Used by field_associate_fields(). 'type' => array('type'), + 'storage_type' => array('storage_type'), ), ); $schema['field_config_instance'] = array( @@ -124,13 +149,14 @@ function field_schema() { ), 'primary key' => array('id'), 'indexes' => array( - // used by field_delete_instance() + // Used by field_delete_instance(). 'field_name_bundle' => array('field_name', 'bundle'), - // used by field_read_instances() - 'widget_active_deleted' => array('widget_active', 'deleted'), - // used by field_modules_disabled() + // Used by field_read_instances(). + 'widget_active' => array('widget_active'), + 'deleted' => array('deleted'), + // Used by field_modules_disabled(). 'widget_module' => array('widget_module'), - // used by field_associate_fields() + // Used by field_associate_fields(). 'widget_type' => array('widget_type'), ), ); |