| 1 | -- Emoji reactions to an issue's or a pull request's description and to |
| 2 | -- the comments on it (reactions.rs). `subject` is the comment's id, or |
| 3 | -- the issue's or pull request's own id for its description; `number` |
| 4 | -- is the issue or pull request, so a conversation's reactions are read |
| 5 | -- with its comments in one statement. |
| 6 | CREATE TABLE reactions ( |
| 7 | subject TEXT NOT NULL, |
| 8 | repo_id TEXT NOT NULL, |
| 9 | number INTEGER NOT NULL, |
| 10 | user_id TEXT NOT NULL, |
| 11 | user_name TEXT NOT NULL, |
| 12 | content TEXT NOT NULL, |
| 13 | created_at TEXT NOT NULL, |
| 14 | PRIMARY KEY (subject, user_id, content) |
| 15 | ); |
| 16 | |
| 17 | CREATE INDEX reactions_by_thread ON reactions (repo_id, number); |
| 18 | CREATE INDEX reactions_by_user ON reactions (user_id); |