[keyserver] Introduce columns in messages table to support pinned messages
Summary:
Introduce two new columns to the messages table to handle messages being pinned.
- pinned - represents a boolean 0 (unpinned) or 1 (pinned)
- pin_time - the time the message was pinned. Necessary so we can display pins from newest to oldest.
- Add an index onto pinned since we'll be querying on messages where pinned = 1 when fetching all pins.
I've also added a migration to update messages.
Test Plan:
Tested the ALTER TABLE` statements locally in TablePlus individually to confirm the columns gets created and no syntax errors are present.
ALTER TABLE messages ADD COLUMN IF NOT EXISTS pinned tinyint(1) UNSIGNED NOT NULL DEFAULT 0, ADD COLUMN IF NOT EXISTS pin_time bigint(20) DEFAULT NULL, ADD INDEX IF NOT EXISTS pinned (pinned);
Also checked the table after the migration was successful:
Reviewers: atul, ginsu, tomek
Reviewed By: tomek
Subscribers: ashoat
Differential Revision: https://phab.comm.dev/D6924