Index: modules/actions/actions.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/actions/actions.module,v
retrieving revision 1.3
diff -u -p -r1.3 actions.module
--- modules/actions/actions.module	29 Aug 2007 14:57:49 -0000	1.3
+++ modules/actions/actions.module	30 Aug 2007 23:46:54 -0000
@@ -174,6 +174,11 @@ function _actions_get_hook_aids($hook, $
  * @param $description
  *   A plain English description of what this hook operation does.
  * @return
+ *   The $form array.
+ *
+ * @ingoup forms
+ * @see actions_assign_form_validate()
+ * @see actions_assign_form_submit()
  */
 function actions_assign_form($form_state, $hook, $op, $description) {
   $form['hook'] = array(
@@ -184,7 +189,8 @@ function actions_assign_form($form_state
     '#type' => 'hidden',
     '#value' => $op,
   );
-  // All of these forms use the same #submit function.
+  // All of these forms use the same validate and submit functions.
+  $form['#validate'][] = 'actions_assign_form_validate';
   $form['#submit'][] = 'actions_assign_form_submit';
 
   $options = array();
@@ -241,6 +247,24 @@ function actions_assign_form($form_state
   return $form;
 }
 
+/**
+ * Validation function for actions_assign_form().
+ *
+ * Makes sure that the user is not re-assigning an action to an event.
+ */
+function actions_assign_form_validate($form, $form_state) {
+  $form_values = $form_state['values'];
+  if (!empty($form_values['aid'])) {
+    $aid = actions_function_lookup($form_values['aid']);
+    if (db_result(db_query("SELECT aid FROM {actions_assignments} WHERE hook = '%s' AND op = '%s' AND aid = '%s'", $form_values['hook'], $form_values['operation'], $aid))) {
+      form_set_error($form_values['operation'], t('The action you choose is already assigned to that event.'));
+    }
+  }
+}
+
+/**
+ * Submit function for actions_assign_form().
+ */
 function actions_assign_form_submit($form, $form_state) {
   $form_values = $form_state['values'];
   if (!empty($form_values['aid'])) {
Index: modules/actions/actions.schema
===================================================================
RCS file: /cvs/drupal/drupal/modules/actions/actions.schema,v
retrieving revision 1.3
diff -u -p -r1.3 actions.schema
--- modules/actions/actions.schema	29 Aug 2007 14:57:49 -0000	1.3
+++ modules/actions/actions.schema	30 Aug 2007 23:46:54 -0000
@@ -9,8 +9,7 @@ function actions_schema() {
       'aid' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
       'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
     ),
-    'index keys' => array(
-      'hook_op' => array('hook', 'op'))
+    'primary key' => array('hook', 'op', 'aid'),
   );
   return $schema;
 }
Index: modules/profile/profile.schema
===================================================================
RCS file: /cvs/drupal/drupal/modules/profile/profile.schema,v
retrieving revision 1.2
diff -u -p -r1.2 profile.schema
--- modules/profile/profile.schema	9 Aug 2007 11:05:40 -0000	1.2
+++ modules/profile/profile.schema	30 Aug 2007 23:46:54 -0000
@@ -29,9 +29,9 @@ function profile_schema() {
       'uid'   => array('type' => 'int', 'unsigned' => TRUE, 'not null' => FALSE, 'default' => 0),
       'value' => array('type' => 'text', 'not null' => FALSE)
     ),
+    'primary key' => array('uid', 'fid'),
     'indexes' => array(
-      'fid' => array('fid'),
-      'uid' => array('uid')
+      'fid' => array('fid')
     ),
   );
 
Index: modules/system/system.schema
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.schema,v
retrieving revision 1.11
diff -u -p -r1.11 system.schema
--- modules/system/system.schema	29 Aug 2007 20:46:18 -0000	1.11
+++ modules/system/system.schema	30 Aug 2007 23:46:54 -0000
@@ -190,7 +190,10 @@ function system_schema() {
       'info'           => array('type' => 'text', 'not null' => FALSE)
     ),
     'primary key' => array('filename'),
-    'indexes' => array('weight' => array('weight')),
+    'indexes' => array(
+      'type_status' => array(array('type', 8), 'status', 'weight', 'filename'),
+      'name_type'   => array(array('name', 16), array('type', 8)),
+    ),
   );
 
   $schema['url_alias'] = array(
Index: modules/taxonomy/taxonomy.schema
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.schema,v
retrieving revision 1.1
diff -u -p -r1.1 taxonomy.schema
--- modules/taxonomy/taxonomy.schema	25 May 2007 12:46:46 -0000	1.1
+++ modules/taxonomy/taxonomy.schema	30 Aug 2007 23:46:54 -0000
@@ -11,6 +11,7 @@ function taxonomy_schema() {
       'weight'      => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny')
     ),
     'primary key' => array('tid'),
+    'unique keys' => array('vid_name' => array('vid', 'name')),
     'indexes' => array('vid' => array('vid')),
   );
 
@@ -35,7 +36,6 @@ function taxonomy_schema() {
     'indexes' => array(
       'nid' => array('nid'),
       'tid' => array('tid'),
-      'vid' => array('vid')
     ),
     'primary key' => array(
       'vid',
