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