OXYGENHUB
# 58ac360b3345 oxygenhub / crates / hub / migrations-pg / 0092_drop_comments.sql
556 B · SQL · last changed Comments on drops (refs #280) 15 days ago source blame history raw
1
-- Comments on a drop (oxygenhub#280): its readers', in Markdown; the
2
-- author, the drop's owner or a site administrator deletes one.
3
CREATE TABLE drop_comments (
4
    id         BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
5
    repo_id    BIGINT NOT NULL REFERENCES repositories(id) ON DELETE CASCADE,
6
    author_id  BIGINT REFERENCES accounts(id) ON DELETE SET NULL,
7
    author     TEXT NOT NULL DEFAULT '',
8
    body       TEXT NOT NULL,
9
    created_ms BIGINT NOT NULL
10
);
11
CREATE INDEX drop_comments_by_drop ON drop_comments (repo_id, created_ms);