Skip to content

Commit 9339f31

Browse files
authored
Merge pull request #33 from topcoder-platform/feature/tco20_update
Updated the tco20 sql script to segregate Challenges
2 parents b099828 + d2741a3 commit 9339f31

File tree

1 file changed

+33
-12
lines changed

1 file changed

+33
-12
lines changed

tco_setup/tco20_eligible_contests.sql

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ WHERE p.project_status_id = 1
2525
-- and mod(p.project_id, 2) = 0
2626
and p.project_id not in (select ce.contest_id from contest_eligibility ce) --excluding private challenges
2727
and not exists (SELECT 1 FROM comp_technology
28-
WHERE comp_vers_id = pi1.value AND technology_type_id = 78) -- exclude QA Challenges from Dev
28+
-- WHERE comp_vers_id = pi1.value AND technology_type_id = 78) -- exclude QA Challenges from Dev
29+
WHERE comp_vers_id = pi1.value AND technology_type_id in (78,27621212)) -- exclude QA/Data Science Challenges from Dev
2930
and 1 = 1;
3031

3132
-- Stage 2
@@ -47,7 +48,8 @@ WHERE p.project_status_id = 1
4748
-- and mod(p.project_id, 2) = 0
4849
and p.project_id not in (select ce.contest_id from contest_eligibility ce) --excluding private challenges
4950
and not exists (SELECT 1 FROM comp_technology
50-
WHERE comp_vers_id = pi1.value AND technology_type_id = 78) -- exclude QA Challenges from Dev
51+
-- WHERE comp_vers_id = pi1.value AND technology_type_id = 78) -- exclude QA Challenges from Dev
52+
WHERE comp_vers_id = pi1.value AND technology_type_id in (78,27621212)) -- exclude QA/Data Science Challenges from Dev
5153
and 1 = 1;
5254

5355

@@ -70,7 +72,8 @@ WHERE p.project_status_id = 1
7072
-- and mod(p.project_id, 2) = 0
7173
and p.project_id not in (select ce.contest_id from contest_eligibility ce) --excluding private challenges
7274
and not exists (SELECT 1 FROM comp_technology
73-
WHERE comp_vers_id = pi1.value AND technology_type_id = 78) -- exclude QA Challenges from Dev
75+
-- WHERE comp_vers_id = pi1.value AND technology_type_id = 78) -- exclude QA Challenges from Dev
76+
WHERE comp_vers_id = pi1.value AND technology_type_id in (78,27621212)) -- exclude QA/Data Science Challenges from Dev
7477
and 1 = 1;
7578

7679

@@ -92,7 +95,9 @@ LEFT OUTER JOIN project_info pi82 ON pi82.project_id = p.project_id and pi82.pro
9295
WHERE p.project_status_id = 1
9396
and
9497
(
95-
p.project_category_id in (9,13) -- include Bug Hunt and Test Suites always
98+
-- p.project_category_id in (9,13) -- include Bug Hunt and Test Suites always
99+
--p.project_category_id in (9,13,38,40) -- include Bug Hunt and Test Suites always, adding f2f and df2f
100+
p.project_category_id in (9,13,37,38,39,40) --including bug hunt,test suits,Marathon,f2f,code,df2f
96101
OR
97102
exists (SELECT 1 FROM comp_technology
98103
WHERE comp_vers_id = pi1.value AND technology_type_id = 78) -- if the challlenge is tagged as QA
@@ -118,7 +123,9 @@ LEFT OUTER JOIN project_info pi82 ON pi82.project_id = p.project_id and pi82.pro
118123
WHERE p.project_status_id = 1
119124
and
120125
(
121-
p.project_category_id in (9,13) -- include Bug Hunt and Test Suites always
126+
-- p.project_category_id in (9,13) -- include Bug Hunt and Test Suites always
127+
--p.project_category_id in (9,13,38,40) -- include Bug Hunt and Test Suites always, adding f2f and df2f
128+
p.project_category_id in (9,13,37,38,39,40) --including bug hunt,test suits,Marathon,f2f,code,df2f
122129
OR
123130
exists (SELECT 1 FROM comp_technology
124131
WHERE comp_vers_id = pi1.value
@@ -146,7 +153,9 @@ LEFT OUTER JOIN project_info pi82 ON pi82.project_id = p.project_id and pi82.pro
146153
WHERE p.project_status_id = 1
147154
and
148155
(
149-
p.project_category_id in (9,13) -- include Bug Hunt and Test Suites always
156+
-- p.project_category_id in (9,13) -- include Bug Hunt and Test Suites always
157+
--p.project_category_id in (9,13,38,40) -- include Bug Hunt and Test Suites always, adding f2f and df2f
158+
p.project_category_id in (9,13,37,38,39,40) --including bug hunt,test suits,Marathon,f2f,code,df2f
150159
OR
151160
exists (SELECT 1 FROM comp_technology
152161
WHERE comp_vers_id = pi1.value
@@ -239,7 +248,8 @@ WHERE p.project_status_id = 1
239248
and p.tc_direct_project_id not in (8943, 16411, 16412, 16413, 16406, 16399, 16407)-- exclude projects for fun and university challenges
240249
-- and mod(p.project_id, 2) = 0
241250
and not exists (SELECT 1 FROM comp_technology
242-
WHERE comp_vers_id = pi1.value AND technology_type_id = 78) -- exclude QA Challenges from F2F
251+
-- WHERE comp_vers_id = pi1.value AND technology_type_id = 78) -- exclude QA Challenges from F2F
252+
WHERE comp_vers_id = pi1.value AND technology_type_id in (78,27621212)) -- exclude QA/Data Science Challenges from F2F
243253
and p.project_id not in (select ce.contest_id from contest_eligibility ce) --excluding private challenges
244254
and 1 = 1;
245255

@@ -261,7 +271,8 @@ WHERE p.project_status_id = 1
261271
and p.tc_direct_project_id not in (16411, 16412, 16413, 16406, 16399, 16407)-- exclude projects for fun and university challenges
262272
-- and mod(p.project_id, 2) = 0
263273
and not exists (SELECT 1 FROM comp_technology
264-
WHERE comp_vers_id = pi1.value AND technology_type_id = 78) -- exclude QA Challenges from F2F
274+
-- WHERE comp_vers_id = pi1.value AND technology_type_id = 78) -- exclude QA Challenges from F2F
275+
WHERE comp_vers_id = pi1.value AND technology_type_id in (78,27621212)) -- exclude QA/Data Science Challenges from F2F
265276
and p.project_id not in (select ce.contest_id from contest_eligibility ce) --excluding private challenges
266277
and 1=1;
267278

@@ -282,7 +293,8 @@ WHERE p.project_status_id = 1
282293
and p.tc_direct_project_id not in (8943, 16411, 16412, 16413, 16406, 16399, 16407)-- exclude projects for fun and university challenges
283294
-- and mod(p.project_id, 2) = 0
284295
and not exists (SELECT 1 FROM comp_technology
285-
WHERE comp_vers_id = pi1.value AND technology_type_id = 78) -- exclude QA Challenges from F2F
296+
-- WHERE comp_vers_id = pi1.value AND technology_type_id = 78) -- exclude QA Challenges from F2F
297+
WHERE comp_vers_id = pi1.value AND technology_type_id in (78,27621212)) -- exclude QA/Data Science Challenges from F2F
286298
and p.project_id not in (select ce.contest_id from contest_eligibility ce) --excluding private challenges
287299
and 1 = 1;
288300

@@ -298,8 +310,11 @@ INNER JOIN project_phase pp ON p.project_id = pp.project_id and pp.phase_type_id
298310
INNER JOIN project_info pi12 ON p.project_id = pi12.project_id and pi12.project_info_type_id = 12 and pi12.value = 'Yes'
299311
INNER JOIN project_info pi14 ON p.project_id = pi14.project_id and pi14.project_info_type_id = 14 and pi14.value = 'Open'
300312
LEFT OUTER JOIN project_info pi82 ON pi82.project_id = p.project_id and pi82.project_info_type_id = 82
313+
LEFT OUTER JOIN project_info pi1 ON pi1.project_id = p.project_id and pi1.project_info_type_id = 1
301314
WHERE p.project_status_id = 1
302-
and p.project_category_id in (37)
315+
-- and p.project_category_id in (37)
316+
and p.project_category_id in (9,13,37,38,39,40) --including bug hunt,test suits,Marathon,f2f,code,df2f
317+
and exists( SELECT 1 FROM comp_technology WHERE comp_vers_id = pi1.value AND technology_type_id = 27621212 )
303318
and p.project_id not in (select project_id from contest_project_xref where contest_id in (703,702)) -- make sure we exclude from tco
304319
and NVL(pi82.value, 0) = 0 -- No TCO if these are tasks
305320
and p.tc_direct_project_id not in (8943, 16411, 16412, 16413, 16406, 16399, 16407)-- exclude projects for fun and university challenges
@@ -316,8 +331,11 @@ INNER JOIN project_phase pp ON p.project_id = pp.project_id and pp.phase_type_id
316331
INNER JOIN project_info pi12 ON p.project_id = pi12.project_id and pi12.project_info_type_id = 12 and pi12.value = 'Yes'
317332
INNER JOIN project_info pi14 ON p.project_id = pi14.project_id and pi14.project_info_type_id = 14 and pi14.value = 'Open'
318333
LEFT OUTER JOIN project_info pi82 ON pi82.project_id = p.project_id and pi82.project_info_type_id = 82
334+
LEFT OUTER JOIN project_info pi1 ON pi1.project_id = p.project_id and pi1.project_info_type_id = 1
319335
WHERE p.project_status_id = 1
320-
and p.project_category_id in (37)
336+
-- and p.project_category_id in (37)
337+
and p.project_category_id in (9,13,37,38,39,40) --including bug hunt,test suits,Marathon,f2f,code,df2f
338+
and exists(SELECT 1 FROM comp_technology WHERE comp_vers_id = pi1.value AND technology_type_id = 27621212 )
321339
and p.project_id not in (select project_id from contest_project_xref where contest_id in (704,702)) -- make sure we exclude from tco
322340
and NVL(pi82.value, 0) = 0 -- No TCO if these are tasks
323341
and p.tc_direct_project_id not in (8943, 16411, 16412, 16413, 16406, 16399, 16407)-- exclude projects for fun and university challenges
@@ -334,8 +352,11 @@ INNER JOIN project_phase pp ON p.project_id = pp.project_id and pp.phase_type_id
334352
INNER JOIN project_info pi12 ON p.project_id = pi12.project_id and pi12.project_info_type_id = 12 and pi12.value = 'Yes'
335353
INNER JOIN project_info pi14 ON p.project_id = pi14.project_id and pi14.project_info_type_id = 14 and pi14.value = 'Open'
336354
LEFT OUTER JOIN project_info pi82 ON pi82.project_id = p.project_id and pi82.project_info_type_id = 82
355+
LEFT OUTER JOIN project_info pi1 ON pi1.project_id = p.project_id and pi1.project_info_type_id = 1
337356
WHERE p.project_status_id = 1
338-
and p.project_category_id in (37)
357+
-- and p.project_category_id in (37)
358+
and p.project_category_id in (9,13,37,38,39,40) --including bug hunt,test suits,Marathon,f2f,code,df2f
359+
and exists(SELECT 1 FROM comp_technology WHERE comp_vers_id = pi1.value AND technology_type_id = 27621212 )
339360
and p.project_id not in (select project_id from contest_project_xref where contest_id in (705,702)) -- make sure we exclude from tco
340361
and NVL(pi82.value, 0) = 0 -- No TCO if these are tasks
341362
and p.tc_direct_project_id not in (8943, 16411, 16412, 16413, 16406, 16399, 16407)-- exclude projects for fun and university challenges

0 commit comments

Comments
 (0)