     'non_ranged',
     c.project_id,
     null,
-    'OPEN'
+    'OPEN',
+    c.id
 FROM commit_comment c, project p
 WHERE c.project_id = p.id AND p.vcs = 'GIT' AND c.line IS null;
 

    dtype,
    project_id,
    pull_request_id,
    state
)
SELECT
    nextval('comment_thread_seq'),

-- Migrate PullRequestComment to ReviewComment and CommentThread

ALTER TABLE comment_thread ADD COLUMN tmp_pull_request_comment_id bigint;
ALTER TABLE comment_thread ADD COLUMN tmp_commit_comment_id bigint;

INSERT INTO comment_thread (
    id,
