HN-like selfhosted forums

Code git clone ssh://git.poy.ooo:6969/~rii/district ZIP
store/migrations/0003_comments_deletes.sql / 645B #6941db34
Raw
-- +goose UpCREATE TABLE IF NOT EXISTS comments (    id         BIGSERIAL   PRIMARY KEY,    post_id    BIGINT      NOT NULL REFERENCES posts(id) ON DELETE CASCADE,    parent_id  BIGINT      REFERENCES comments(id) ON DELETE SET NULL,    author_id  UUID        NOT NULL REFERENCES users(id),    body       TEXT        NOT NULL,    created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),    deleted_at TIMESTAMPTZ);CREATE INDEX comments_post_id_idx    ON comments(post_id);CREATE INDEX comments_parent_id_idx    ON comments(parent_id);-- +goose DownDROP INDEX comments_parent_id_idx;DROP INDEX comments_post_id_idx;DROP TABLE comments;