Skip to content

Commit 2d40fd4

Browse files
authored
Merge pull request #35 from topcoder-platform/feature/tco20_update
Fix Marathon Match Query to include Marathon Matches irrespective of …
2 parents af84ee1 + 30efd02 commit 2d40fd4

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

tco_setup/tco20_eligible_contests.sql

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,12 @@ INNER JOIN project_info pi14 ON p.project_id = pi14.project_id and pi14.project_
306306
LEFT OUTER JOIN project_info pi82 ON pi82.project_id = p.project_id and pi82.project_info_type_id = 82
307307
LEFT OUTER JOIN project_info pi1 ON pi1.project_id = p.project_id and pi1.project_info_type_id = 1
308308
WHERE p.project_status_id = 1
309-
-- and p.project_category_id in (37)
310-
and p.project_category_id in (9,13,37,38,39,40) --including bug hunt,test suits,Marathon,f2f,code,df2f
311-
and exists( SELECT 1 FROM comp_technology WHERE comp_vers_id = pi1.value AND technology_type_id = 27621212 )
309+
and (
310+
p.project_category_id in (37) -- include marathon matches always
311+
OR
312+
exists (SELECT 1 FROM comp_technology
313+
WHERE comp_vers_id = pi1.value AND technology_type_id = 27621212) -- if the challlenge is tagged as Data Science
314+
)
312315
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
313316
and NVL(pi82.value, 0) = 0 -- No TCO if these are tasks
314317
and p.tc_direct_project_id not in (8943, 16411, 16412, 16413, 16406, 16399, 16407)-- exclude projects for fun and university challenges
@@ -327,9 +330,12 @@ INNER JOIN project_info pi14 ON p.project_id = pi14.project_id and pi14.project_
327330
LEFT OUTER JOIN project_info pi82 ON pi82.project_id = p.project_id and pi82.project_info_type_id = 82
328331
LEFT OUTER JOIN project_info pi1 ON pi1.project_id = p.project_id and pi1.project_info_type_id = 1
329332
WHERE p.project_status_id = 1
330-
-- and p.project_category_id in (37)
331-
and p.project_category_id in (9,13,37,38,39,40) --including bug hunt,test suits,Marathon,f2f,code,df2f
332-
and exists(SELECT 1 FROM comp_technology WHERE comp_vers_id = pi1.value AND technology_type_id = 27621212 )
333+
and (
334+
p.project_category_id in (37) -- include marathon matches always
335+
OR
336+
exists (SELECT 1 FROM comp_technology
337+
WHERE comp_vers_id = pi1.value AND technology_type_id = 27621212) -- if the challlenge is tagged as Data Science
338+
)
333339
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
334340
and NVL(pi82.value, 0) = 0 -- No TCO if these are tasks
335341
and p.tc_direct_project_id not in (8943, 16411, 16412, 16413, 16406, 16399, 16407)-- exclude projects for fun and university challenges
@@ -348,9 +354,12 @@ INNER JOIN project_info pi14 ON p.project_id = pi14.project_id and pi14.project_
348354
LEFT OUTER JOIN project_info pi82 ON pi82.project_id = p.project_id and pi82.project_info_type_id = 82
349355
LEFT OUTER JOIN project_info pi1 ON pi1.project_id = p.project_id and pi1.project_info_type_id = 1
350356
WHERE p.project_status_id = 1
351-
-- and p.project_category_id in (37)
352-
and p.project_category_id in (9,13,37,38,39,40) --including bug hunt,test suits,Marathon,f2f,code,df2f
353-
and exists(SELECT 1 FROM comp_technology WHERE comp_vers_id = pi1.value AND technology_type_id = 27621212 )
357+
and (
358+
p.project_category_id in (37) -- include marathon matches always
359+
OR
360+
exists (SELECT 1 FROM comp_technology
361+
WHERE comp_vers_id = pi1.value AND technology_type_id = 27621212) -- if the challlenge is tagged as Data Science
362+
)
354363
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
355364
and NVL(pi82.value, 0) = 0 -- No TCO if these are tasks
356365
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)