--- /dev/null
+Return-Path: <aclements@csail.mit.edu>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 61E17431FD7\r
+ for <notmuch@notmuchmail.org>; Thu, 23 Oct 2014 05:31:01 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.3\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id uyJFLH0BxbSu for <notmuch@notmuchmail.org>;\r
+ Thu, 23 Oct 2014 05:30:55 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-8.mit.edu (dmz-mailsec-scanner-8.mit.edu\r
+ [18.7.68.37])\r
+ (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 83F75431FDB\r
+ for <notmuch@notmuchmail.org>; Thu, 23 Oct 2014 05:30:52 -0700 (PDT)\r
+X-AuditID: 12074425-f79e46d000002583-91-5448f4fb4426\r
+Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
+ (using TLS with cipher AES256-SHA (256/256 bits))\r
+ (Client did not present a certificate)\r
+ by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP\r
+ id 3C.F4.09603.BF4F8445; Thu, 23 Oct 2014 08:30:51 -0400 (EDT)\r
+Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
+ by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id s9NCUm1e030502; \r
+ Thu, 23 Oct 2014 08:30:48 -0400\r
+Received: from drake.dyndns.org\r
+ (216-15-114-40.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com\r
+ [216.15.114.40]) (authenticated bits=0)\r
+ (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+ by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s9NCUhdb008928\r
+ (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT);\r
+ Thu, 23 Oct 2014 08:30:46 -0400\r
+Received: from amthrax by drake.dyndns.org with local (Exim 4.84)\r
+ (envelope-from <aclements@csail.mit.edu>)\r
+ id 1XhHXP-0007bg-6q; Thu, 23 Oct 2014 08:30:43 -0400\r
+From: Austin Clements <aclements@csail.mit.edu>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v3 2/9] lib: Update database schema doc for ghost messages\r
+Date: Thu, 23 Oct 2014 08:30:34 -0400\r
+Message-Id: <1414067441-29054-3-git-send-email-aclements@csail.mit.edu>\r
+X-Mailer: git-send-email 2.1.0\r
+In-Reply-To: <1414067441-29054-1-git-send-email-aclements@csail.mit.edu>\r
+References: <1414067441-29054-1-git-send-email-aclements@csail.mit.edu>\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFtrLIsWRmVeSWpSXmKPExsUixG6nrvv7i0eIwdSHxhar5/JYXL85k9mB\r
+ yWPnrLvsHs9W3WIOYIrisklJzcksSy3St0vgyvg3cyNbwUz+iqY9/xkbGP9ydzFyckgImEg8\r
+ OLuUFcIWk7hwbz1bFyMXh5DAbCaJP7ueMkE4GxklDjzZwQjh3GGSaP7Zwg7hLGGU6LjdwQjS\r
+ zyagL7Fi7SSwWSIC0hI7784Gs5kFHCU+71/EBmILC3hJLDrxCKyeRUBVYmZLP5jNK+AucWTi\r
+ IiaIO+QkNuz+DxbnFPCQ2LPjDlivEFDN9ucHWScw8i9gZFjFKJuSW6Wbm5iZU5yarFucnJiX\r
+ l1qka6GXm1mil5pSuokRHEouqjsYJxxSOsQowMGoxMN7IdUjRIg1say4MvcQoyQHk5Iob8wD\r
+ oBBfUn5KZUZicUZ8UWlOavEhRgkOZiUR3vgLQDnelMTKqtSifJiUNAeLkjjvph98IUIC6Ykl\r
+ qdmpqQWpRTBZGQ4OJQleRmDMCAkWpaanVqRl5pQgpJk4OEGG8wANv/UZZHhxQWJucWY6RP4U\r
+ o6KUOG8ySEIAJJFRmgfXC4v1V4ziQK8I86qBrOABpgm47ldAg5lArt4ANrgkESEl1cA4q3Tr\r
+ hfxVa9ZXLjle3L70w6Td9l+irnE6XA+dOvXP7hcKknwufsmzBI9Mtr+/w+rxX+Ub9ZrpPZGL\r
+ zq2J9pX619et8nE+72nNKLO4XL7jfDv7Nh+z5PtnIvzYNE/k16+fGqHWHE0HpQObc05prtqw\r
+ r0jp8aN/jyps3itb3S54cKOwaa2Y5Q1/JZbijERDLeai4kQAWv7LkdACAAA=\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 23 Oct 2014 12:31:01 -0000\r
+\r
+From: Austin Clements <amdragon@mit.edu>\r
+\r
+This describes the structure of ghost mail documents. Ghost messages\r
+are not yet implemented.\r
+---\r
+ lib/database.cc | 20 ++++++++++++++++++--\r
+ 1 file changed, 18 insertions(+), 2 deletions(-)\r
+\r
+diff --git a/lib/database.cc b/lib/database.cc\r
+index 8fd7fad..c641bcd 100644\r
+--- a/lib/database.cc\r
++++ b/lib/database.cc\r
+@@ -50,8 +50,8 @@ typedef struct {\r
+ \r
+ /* Here's the current schema for our database (for NOTMUCH_DATABASE_VERSION):\r
+ *\r
+- * We currently have two different types of documents (mail and\r
+- * directory) and also some metadata.\r
++ * We currently have three different types of documents (mail, ghost,\r
++ * and directory) and also some metadata.\r
+ *\r
+ * Mail document\r
+ * -------------\r
+@@ -109,6 +109,15 @@ typedef struct {\r
+ *\r
+ * The data portion of a mail document is empty.\r
+ *\r
++ * Ghost mail document [if NOTMUCH_FEATURE_GHOSTS]\r
++ * -----------------------------------------------\r
++ * A ghost mail document is like a mail document, but where we don't\r
++ * have the message content. These are used to track thread reference\r
++ * information for messages we haven't received.\r
++ *\r
++ * A ghost mail document has type: ghost; id and thread fields that\r
++ * are identical to the mail document fields; and a MESSAGE_ID value.\r
++ *\r
+ * Directory document\r
+ * ------------------\r
+ * A directory document is used by a client of the notmuch library to\r
+@@ -172,6 +181,13 @@ typedef struct {\r
+ * generated is 1 and the value will be\r
+ * incremented for each thread ID.\r
+ *\r
++ * Obsolete metadata\r
++ * -----------------\r
++ *\r
++ * If ! NOTMUCH_FEATURE_GHOSTS, there are no ghost mail documents.\r
++ * Instead, the database has the following additional database\r
++ * metadata:\r
++ *\r
+ * thread_id_* A pre-allocated thread ID for a particular\r
+ * message. This is actually an arbitrarily large\r
+ * family of metadata name. Any particular name is\r
+-- \r
+2.1.0\r
+\r