@@ -89,7 +89,7 @@ DELETE FROM metric WHERE branch='master' AND type=4;
8989-- commit
9090INSERT INTO metric (repository_id, branch, type, value, year, month, day, hour)
9191SELECT repository_id, 'master', 4, COUNT(*), year, year*100+month, (year*100+month)*100+day, (year*10000+month*100+day)*100+hour
92- FROM gitwize. commit_data
92+ FROM commit_data
9393GROUP BY repository_id, year, month, day, hour
9494;
9595
@@ -98,7 +98,7 @@ DELETE FROM metric WHERE branch='master' AND type=3;
9898-- line added
9999INSERT INTO metric (repository_id, branch, type, value, year, month, day, hour)
100100SELECT repository_id, 'master', 3, SUM(addition_loc), year, year*100+month, (year*100+month)*100+day, (year*10000+month*100+day)*100+hour
101- FROM gitwize. commit_data
101+ FROM commit_data
102102GROUP BY repository_id, year, month, day, hour
103103;
104104
@@ -107,7 +107,7 @@ DELETE FROM metric WHERE branch='master' AND type=2;
107107-- line removed
108108INSERT INTO metric (repository_id, branch, type, value, year, month, day, hour)
109109SELECT repository_id, 'master', 2, SUM(deletion_loc), year, year*100+month, (year*100+month)*100+day, (year*10000+month*100+day)*100+hour
110- FROM gitwize. commit_data
110+ FROM commit_data
111111GROUP BY repository_id, year, month, day, hour
112112;
113113
@@ -117,7 +117,7 @@ DELETE FROM metric WHERE branch='master' AND type=5;
117117INSERT INTO metric(repository_id, branch, type, year, month, day, hour, value)
118118SELECT repository_id, 'master' as branch, 5 as type, created_year as year,
119119 created_month as month, created_day as day, created_hour as hour, COUNT(*) as value
120- FROM gitwize. pull_request
120+ FROM pull_request
121121GROUP BY repository_id, created_year, created_month, created_day, created_hour
122122;
123123
@@ -127,7 +127,7 @@ DELETE FROM metric WHERE branch='master' AND type=6;
127127INSERT INTO metric(repository_id, branch, type, year, month, day, hour, value)
128128SELECT repository_id, 'master' as branch, 6 as type, closed_year as year,
129129 closed_month as month, closed_day as day, closed_hour as hour, COUNT(*) as value
130- FROM gitwize. pull_request
130+ FROM pull_request
131131WHERE state = 'merged'
132132GROUP BY repository_id, closed_year, closed_month, closed_day, closed_hour
133133;
@@ -138,7 +138,7 @@ DELETE FROM metric WHERE branch='master' AND type=7;
138138INSERT INTO metric(repository_id, branch, type, year, month, day, hour, value)
139139SELECT repository_id, 'master' as branch, 7 as type, closed_year as year,
140140 closed_month as month, closed_day as day, closed_hour as hour, COUNT(*) as value
141- FROM gitwize. pull_request
141+ FROM pull_request
142142WHERE state = 'rejected'
143143GROUP BY repository_id, closed_year, closed_month, closed_day, closed_hour
144144;
@@ -154,7 +154,7 @@ DELETE FROM metric WHERE branch='master' AND type=4 AND repository_id=$repoID;
154154-- commit
155155INSERT INTO metric (repository_id, branch, type, value, year, month, day, hour)
156156SELECT repository_id, 'master', 4, COUNT(*), year, year*100+month, (year*100+month)*100+day, (year*10000+month*100+day)*100+hour
157- FROM gitwize. commit_data
157+ FROM commit_data
158158WHERE repository_id=$repoID
159159GROUP BY repository_id, year, month, day, hour
160160;
@@ -164,7 +164,7 @@ DELETE FROM metric WHERE branch='master' AND type=3 AND repository_id=$repoID;
164164-- line added
165165INSERT INTO metric (repository_id, branch, type, value, year, month, day, hour)
166166SELECT repository_id, 'master', 3, SUM(addition_loc), year, year*100+month, (year*100+month)*100+day, (year*10000+month*100+day)*100+hour
167- FROM gitwize. commit_data
167+ FROM commit_data
168168WHERE repository_id=$repoID
169169GROUP BY repository_id, year, month, day, hour
170170;
@@ -174,7 +174,7 @@ DELETE FROM metric WHERE branch='master' AND type=2 AND repository_id=$repoID;
174174-- line removed
175175INSERT INTO metric (repository_id, branch, type, value, year, month, day, hour)
176176SELECT repository_id, 'master', 2, SUM(deletion_loc), year, year*100+month, (year*100+month)*100+day, (year*10000+month*100+day)*100+hour
177- FROM gitwize. commit_data
177+ FROM commit_data
178178WHERE repository_id=$repoID
179179GROUP BY repository_id, year, month, day, hour
180180;
@@ -185,7 +185,7 @@ DELETE FROM metric WHERE branch='master' AND type=5 AND repository_id=$repoID;
185185INSERT INTO metric(repository_id, branch, type, year, month, day, hour, value)
186186SELECT repository_id, 'master' as branch, 5 as type, created_year as year,
187187 created_month as month, created_day as day, created_hour as hour, COUNT(*) as value
188- FROM gitwize. pull_request
188+ FROM pull_request
189189WHERE repository_id=$repoID
190190GROUP BY repository_id, created_year, created_month, created_day, created_hour
191191;
@@ -196,7 +196,7 @@ DELETE FROM metric WHERE branch='master' AND type=6 AND repository_id=$repoID;
196196INSERT INTO metric(repository_id, branch, type, year, month, day, hour, value)
197197SELECT repository_id, 'master' as branch, 6 as type, closed_year as year,
198198 closed_month as month, closed_day as day, closed_hour as hour, COUNT(*) as value
199- FROM gitwize. pull_request
199+ FROM pull_request
200200WHERE state = 'merged' AND repository_id=$repoID
201201GROUP BY repository_id, closed_year, closed_month, closed_day, closed_hour
202202;
@@ -207,7 +207,7 @@ DELETE FROM metric WHERE branch='master' AND type=7 AND repository_id=$repoID;
207207INSERT INTO metric(repository_id, branch, type, year, month, day, hour, value)
208208SELECT repository_id, 'master' as branch, 7 as type, closed_year as year,
209209 closed_month as month, closed_day as day, closed_hour as hour, COUNT(*) as value
210- FROM gitwize. pull_request
210+ FROM pull_request
211211WHERE state = 'rejected' AND repository_id=$repoID
212212GROUP BY repository_id, closed_year, closed_month, closed_day, closed_hour
213213;
0 commit comments