internal/store/migrations/0038_pending_review.up.sql

v1.28.1
gitbay/internal/store/migrations/0038_pending_review.up.sql history · blame · raw

13 lines · 824 bytes

 1-- A review composed as a unit and submitted at once. A diff comment used
 2-- to post the moment it was written, so a reviewer reading a change had
 3-- to either publish half-formed thoughts one at a time or keep them
 4-- somewhere else until they were done (#111).
 5--
 6-- pending marks a comment belonging to a review its author has not
 7-- submitted yet: visible to them alone, and published by `mr review`
 8-- along with the verdict. Default 0, so every comment that already
 9-- exists is published, which is what it was.
10ALTER TABLE mr_diff_comments ADD COLUMN pending INTEGER NOT NULL DEFAULT 0;
11-- The unresolved-thread merge gate and every listing filter on this, per
12-- viewer, and one reviewer's pending set is small against the table.
13CREATE INDEX mr_diff_comments_pending ON mr_diff_comments(mr_id, author_id, pending);