diff --git a/cck.install b/cck.install index 49a2f9b2c..aad9102d9 100644 --- a/cck.install +++ b/cck.install @@ -24,6 +24,12 @@ function cck_schema() { $schema['cck_field_settings'] = array( 'fields' => array( + 'id' => array( + 'description' => 'The unique identifier for field settings.', + 'type' => 'serial', + 'unsigned' => TRUE, + 'not null' => TRUE, + ), 'field_name' => array( 'type' => 'varchar', 'length' => 32, @@ -68,6 +74,7 @@ function cck_schema() { 'description' => 'The custom value for this setting.', ), ), + 'primary key' => array('id'), ); return $schema; } @@ -93,3 +100,19 @@ function cck_update_7000() { db_add_field('cck_field_settings', 'language', $field); } } + +/** + * Add a primary key. + */ +function cck_update_7001() { + if (!db_field_exists('cck_field_settings', 'id')) { + db_add_field('cck_field_settings', 'id', + array( + 'description' => 'The unique identifier for field settings.', + 'type' => 'serial', + 'unsigned' => TRUE, + 'not null' => TRUE, + ), + array('primary key' => array('id'))); + } +}