diff --git a/core/modules/comment/comment.install b/core/modules/comment/comment.install
index 4b3c9fc..a4cd899 100644
--- a/core/modules/comment/comment.install
+++ b/core/modules/comment/comment.install
@@ -183,6 +183,9 @@ function comment_schema() {
       'comment_created' => array('created'),
     ),
     'primary key' => array('cid'),
+    'unique keys' => array(
+      'comment_unique_thread' => array('nid', 'thread'),
+    ),
     'foreign keys' => array(
       'comment_node' => array(
         'table' => 'node',
@@ -282,6 +285,16 @@ function comment_update_8000() {
 }
 
 /**
+ * Ensures there are no duplicate {comment}.thread values for the same {comment}.nid.
+ * See https://drupal.org/node/1685170 for details.
+ */
+function comment_update_8001() {
+  if (!db_index_exists('comment', 'comment_unique_thread')) {
+    db_add_index('comment', 'comment_unique_thread', array('nid', 'thread'));
+  }
+}
+
+/**
  * @} End of "addtogroup updates-7.x-to-8.x".
  * The next series of updates should start at 9000.
  */
