[keyserver] Add search table to the db
Summary:
issue: https://linear.app/comm/issue/ENG-3313/create-a-table-in-the-db-for-holding-processed-messages-for-search
We will hold messages processed for search in a new bd table. This table will has:
- processed_content - stemmed and stripped of stopwords content. When the message changes, this filed will be updated accordingly.
- message_id the id of the message. When the message gets edited, this id will be updated to the id of the edit message. Otherwise fetching the correct full content would be difficult.
- original_message_id - the id of the original message. This is first of all to have a primary key in this table that doesn't change (since message_id will be changing). The id of the original
message was just a natural candidate for this. Secondly, since we already have this, this will be used to fetch the original message (to ex access creation time or the author)
For now we will be only keeping here processed text messages, but we might extend this to ex calendar entries in the future.
Test Plan: Run yarn dev in keyserver/ checked that the migration succeeds. Created a new db, attached it in db_config.json, run yarn dev in keyserver/, cheked that the db is created correctly.
Reviewers: kamil, bartek, ashoat
Reviewed By: ashoat
Subscribers: tomek, atul
Differential Revision: https://phab.comm.dev/D7076