Jump to…
snowinitial commitqoxwzsukwmkx1mo
Matt W1-- M2: repository settings and collaborator management.
Matt W2
Matt W3-- Who granted a collaborator role. The audit log records the action, but the
Matt W4-- current state should also say who is responsible for it — an audit trail that
Matt W5-- has been trimmed by retention must not lose the answer to "why does this
Matt W6-- person have write access".
Matt W7ALTER TABLE repo_collaborators
Matt W8 ADD COLUMN added_by uuid REFERENCES users ON DELETE SET NULL;
Matt W9
Matt W10-- The default bookmark is protected implicitly (the UI shows it as "always"),
Matt W11-- but the hook enforces protection from the `bookmarks` table alone, so the row
Matt W12-- has to agree. Backfilled here and maintained by the indexer thereafter.
Matt W13UPDATE bookmarks b
Matt W14 SET protected = true
Matt W15 FROM repos r
Matt W16 WHERE r.id = b.repo_id
Matt W17 AND b.name = r.default_bookmark
Matt W18 AND b.protected = false;

18 lines · SQL