summaryrefslogtreecommitdiff
path: root/modules/field/field.install
diff options
context:
space:
mode:
Diffstat (limited to 'modules/field/field.install')
-rw-r--r--modules/field/field.install23
1 files changed, 21 insertions, 2 deletions
diff --git a/modules/field/field.install b/modules/field/field.install
index 737c1da42..49972a4d0 100644
--- a/modules/field/field.install
+++ b/modules/field/field.install
@@ -15,6 +15,11 @@ function field_schema() {
// Static (meta) tables.
$schema['field_config'] = array(
'fields' => array(
+ 'id' => array(
+ 'type' => 'serial',
+ 'not null' => TRUE,
+ 'description' => 'The primary identifier for a field',
+ ),
'field_name' => array(
'type' => 'varchar',
'length' => 32,
@@ -66,7 +71,8 @@ function field_schema() {
'default' => 0,
),
),
- 'primary key' => array('field_name'),
+ 'primary key' => array('id'),
+ 'unique keys' => array('field_name' => array('field_name')),
'indexes' => array(
// used by field_read_fields
'active_deleted' => array('active', 'deleted'),
@@ -78,6 +84,16 @@ function field_schema() {
);
$schema['field_config_instance'] = array(
'fields' => array(
+ 'id' => array(
+ 'type' => 'serial',
+ 'not null' => TRUE,
+ 'description' => 'The primary identifier for a field instance',
+ ),
+ 'field_id' => array(
+ 'type' => 'int',
+ 'not null' => TRUE,
+ 'description' => 'The identifier of the field attached by this instance',
+ ),
'field_name' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''),
'bundle' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''),
'widget_type' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''),
@@ -106,7 +122,10 @@ function field_schema() {
'default' => 0,
),
),
- 'primary key' => array('field_name', 'bundle'),
+ 'primary key' => array('id'),
+ 'unique keys' => array(
+ 'field_name_bundle' => array('field_name', 'bundle'),
+ ),
'indexes' => array(
// used by field_read_instances
'widget_active_deleted' => array('widget_active', 'deleted'),