consider removing thread_id from Message and just having reply_to.  We'd then have a separate "reporting" table with two columns, (1) message_id (FK to this table's ID) and (2) THREAD, also a FK to this table's ID).  The ID of the first message in a thread is the ID of the thread.