Skip to content

Commit b0f881f

Browse files
authored
Merge pull request #67 from carlosms/update-default-query
Update default query for gitbase v0.12.1-rc1
2 parents ac7cbfd + 0423859 commit b0f881f

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

frontend/src/App.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ class App extends Component {
1414
this.state = {
1515
sql: `/* Contributor's number of commits, each month of 2018, for each repository */
1616
17-
SELECT COUNT(*) as num_commits, month, repo_id, committer_name FROM (
18-
SELECT MONTH(committer_when) as month, r.id as repo_id, committer_name
19-
FROM repositories r
20-
INNER JOIN refs ON refs.repository_id = r.id AND refs.name = 'HEAD'
21-
INNER JOIN commits c ON YEAR(committer_when) = 2018 AND history_idx(refs.hash, c.hash) >= 0
22-
) as t
23-
GROUP BY committer_name, month, repo_id`,
17+
SELECT COUNT(*) as num_commits, month, repo_id, committer_name
18+
FROM ( SELECT MONTH(committer_when) as month,
19+
r.repository_id as repo_id,
20+
committer_name
21+
FROM ref_commits r
22+
INNER JOIN commits c
23+
ON YEAR(c.committer_when) = 2018 AND r.commit_hash = c.commit_hash
24+
WHERE r.ref_name = 'HEAD'
25+
) as t GROUP BY committer_name, month, repo_id`,
2426
results: new Map(),
2527
schema: undefined,
2628
// modal

0 commit comments

Comments
 (0)