| 1 |
CREATE TABLE post_mentions ( |
| 2 |
post_id UUID NOT NULL REFERENCES posts(id) ON DELETE CASCADE, |
| 3 |
mentioned_user_id UUID NOT NULL REFERENCES users(mnw_account_id) ON DELETE CASCADE, |
| 4 |
created_at TIMESTAMPTZ NOT NULL DEFAULT now(), |
| 5 |
PRIMARY KEY (post_id, mentioned_user_id) |
| 6 |
); |
| 7 |
CREATE INDEX idx_post_mentions_user ON post_mentions(mentioned_user_id); |
| 8 |
|