···489489 query = `select count(id) from repos where did = ?`
490490 args = append(args, did)
491491 case models.VanityStatStarCount:
492492- query = `select count(id) from stars where subject_at like 'at://' || ? || '%'`
492492+ query = `select count(s.id) from stars s join repos r on s.subject = r.repo_did where s.subject_type = 'repo' and r.did = ?`
493493 args = append(args, did)
494494 case models.VanityStatNone:
495495 return 0, nil
···6060 on r.did = inp.owner_did
6161 and r.name = inp.name
6262 join issues i
6363- on i.repo_at = r.at_uri
6363+ on i.repo_did = r.repo_did
6464 and i.issue_id = inp.issue_id
6565 left join issue_comments c
6666 on inp.comment_id is not null
···131131 on r.did = inp.owner_did
132132 and r.name = inp.name
133133 join pulls p
134134- on p.repo_at = r.at_uri
134134+ on p.repo_did = r.repo_did
135135 and p.pull_id = inp.pull_id
136136 left join pull_comments c
137137 on inp.comment_id is not null
138138- and c.repo_at = r.at_uri and c.pull_id = p.pull_id
138138+ and c.repo_did = p.repo_did and c.pull_id = p.pull_id
139139 and c.id = inp.comment_id
140140 `,
141141 strings.Join(vals, ","),
···319319 `select r.did, r.name, i.issue_id, i.title, i.open
320320 from issues i
321321 join repos r
322322- on r.at_uri = i.repo_at
322322+ on r.repo_did = i.repo_did
323323 where (i.did, i.rkey) in (%s)`,
324324 strings.Join(vals, ","),
325325 ),
···357357 join issues i
358358 on i.at_uri = c.issue_at
359359 join repos r
360360- on r.at_uri = i.repo_at
360360+ on r.repo_did = i.repo_did
361361 where %s and %s`,
362362 filter.Condition(),
363363 exclude.Condition(),
···401401 `select r.did, r.name, p.pull_id, p.title, p.state
402402 from pulls p
403403 join repos r
404404- on r.at_uri = p.repo_at
404404+ on r.repo_did = p.repo_did
405405 where (p.owner_did, p.rkey) in (%s)`,
406406 strings.Join(vals, ","),
407407 ),
···437437 `select r.did, r.name, p.pull_id, c.id, p.title, p.state
438438 from repos r
439439 join pulls p
440440- on r.at_uri = p.repo_at
440440+ on r.repo_did = p.repo_did
441441 join pull_comments c
442442- on r.at_uri = c.repo_at and p.pull_id = c.pull_id
442442+ on p.repo_did = c.repo_did and p.pull_id = c.pull_id
443443 where %s and %s`,
444444 filter.Condition(),
445445 exclude.Condition(),