summaryrefslogtreecommitdiff
path: root/modules/field/field.install
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-03-10 09:45:32 +0000
committerDries Buytaert <dries@buytaert.net>2009-03-10 09:45:32 +0000
commit4ac090eb54ecc7ad5bf5df42c7fda0c76d89a611 (patch)
tree1f78a6872b45cc1d3468bd0c2cc011680e3f7b33 /modules/field/field.install
parenta4ee7092e1ebfe3cc2387ad4b72f723080601cd4 (diff)
downloadbrdo-4ac090eb54ecc7ad5bf5df42c7fda0c76d89a611.tar.gz
brdo-4ac090eb54ecc7ad5bf5df42c7fda0c76d89a611.tar.bz2
- Patch #392686 by bjaspan, yched: switch to serial primary keys.
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'),