Skip to content

Updated the tco20 sql script to segregate Challenges #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 3, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 33 additions & 12 deletions tco_setup/tco20_eligible_contests.sql
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ WHERE p.project_status_id = 1
-- and mod(p.project_id, 2) = 0
and p.project_id not in (select ce.contest_id from contest_eligibility ce) --excluding private challenges
and not exists (SELECT 1 FROM comp_technology
WHERE comp_vers_id = pi1.value AND technology_type_id = 78) -- exclude QA Challenges from Dev
-- WHERE comp_vers_id = pi1.value AND technology_type_id = 78) -- exclude QA Challenges from Dev
WHERE comp_vers_id = pi1.value AND technology_type_id in (78,27621212)) -- exclude QA/Data Science Challenges from Dev
and 1 = 1;

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


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


Expand All @@ -92,7 +95,9 @@ LEFT OUTER JOIN project_info pi82 ON pi82.project_id = p.project_id and pi82.pro
WHERE p.project_status_id = 1
and
(
p.project_category_id in (9,13) -- include Bug Hunt and Test Suites always
-- p.project_category_id in (9,13) -- include Bug Hunt and Test Suites always
--p.project_category_id in (9,13,38,40) -- include Bug Hunt and Test Suites always, adding f2f and df2f
p.project_category_id in (9,13,37,38,39,40) --including bug hunt,test suits,Marathon,f2f,code,df2f
OR
exists (SELECT 1 FROM comp_technology
WHERE comp_vers_id = pi1.value AND technology_type_id = 78) -- if the challlenge is tagged as QA
Expand All @@ -118,7 +123,9 @@ LEFT OUTER JOIN project_info pi82 ON pi82.project_id = p.project_id and pi82.pro
WHERE p.project_status_id = 1
and
(
p.project_category_id in (9,13) -- include Bug Hunt and Test Suites always
-- p.project_category_id in (9,13) -- include Bug Hunt and Test Suites always
--p.project_category_id in (9,13,38,40) -- include Bug Hunt and Test Suites always, adding f2f and df2f
p.project_category_id in (9,13,37,38,39,40) --including bug hunt,test suits,Marathon,f2f,code,df2f
OR
exists (SELECT 1 FROM comp_technology
WHERE comp_vers_id = pi1.value
Expand Down Expand Up @@ -146,7 +153,9 @@ LEFT OUTER JOIN project_info pi82 ON pi82.project_id = p.project_id and pi82.pro
WHERE p.project_status_id = 1
and
(
p.project_category_id in (9,13) -- include Bug Hunt and Test Suites always
-- p.project_category_id in (9,13) -- include Bug Hunt and Test Suites always
--p.project_category_id in (9,13,38,40) -- include Bug Hunt and Test Suites always, adding f2f and df2f
p.project_category_id in (9,13,37,38,39,40) --including bug hunt,test suits,Marathon,f2f,code,df2f
OR
exists (SELECT 1 FROM comp_technology
WHERE comp_vers_id = pi1.value
Expand Down Expand Up @@ -239,7 +248,8 @@ WHERE p.project_status_id = 1
and p.tc_direct_project_id not in (8943, 16411, 16412, 16413, 16406, 16399, 16407)-- exclude projects for fun and university challenges
-- and mod(p.project_id, 2) = 0
and not exists (SELECT 1 FROM comp_technology
WHERE comp_vers_id = pi1.value AND technology_type_id = 78) -- exclude QA Challenges from F2F
-- WHERE comp_vers_id = pi1.value AND technology_type_id = 78) -- exclude QA Challenges from F2F
WHERE comp_vers_id = pi1.value AND technology_type_id in (78,27621212)) -- exclude QA/Data Science Challenges from F2F
and p.project_id not in (select ce.contest_id from contest_eligibility ce) --excluding private challenges
and 1 = 1;

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

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

Expand All @@ -298,8 +310,11 @@ INNER JOIN project_phase pp ON p.project_id = pp.project_id and pp.phase_type_id
INNER JOIN project_info pi12 ON p.project_id = pi12.project_id and pi12.project_info_type_id = 12 and pi12.value = 'Yes'
INNER JOIN project_info pi14 ON p.project_id = pi14.project_id and pi14.project_info_type_id = 14 and pi14.value = 'Open'
LEFT OUTER JOIN project_info pi82 ON pi82.project_id = p.project_id and pi82.project_info_type_id = 82
LEFT OUTER JOIN project_info pi1 ON pi1.project_id = p.project_id and pi1.project_info_type_id = 1
WHERE p.project_status_id = 1
and p.project_category_id in (37)
-- and p.project_category_id in (37)
and p.project_category_id in (9,13,37,38,39,40) --including bug hunt,test suits,Marathon,f2f,code,df2f
and exists( SELECT 1 FROM comp_technology WHERE comp_vers_id = pi1.value AND technology_type_id = 27621212 )
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
and NVL(pi82.value, 0) = 0 -- No TCO if these are tasks
and p.tc_direct_project_id not in (8943, 16411, 16412, 16413, 16406, 16399, 16407)-- exclude projects for fun and university challenges
Expand All @@ -316,8 +331,11 @@ INNER JOIN project_phase pp ON p.project_id = pp.project_id and pp.phase_type_id
INNER JOIN project_info pi12 ON p.project_id = pi12.project_id and pi12.project_info_type_id = 12 and pi12.value = 'Yes'
INNER JOIN project_info pi14 ON p.project_id = pi14.project_id and pi14.project_info_type_id = 14 and pi14.value = 'Open'
LEFT OUTER JOIN project_info pi82 ON pi82.project_id = p.project_id and pi82.project_info_type_id = 82
LEFT OUTER JOIN project_info pi1 ON pi1.project_id = p.project_id and pi1.project_info_type_id = 1
WHERE p.project_status_id = 1
and p.project_category_id in (37)
-- and p.project_category_id in (37)
and p.project_category_id in (9,13,37,38,39,40) --including bug hunt,test suits,Marathon,f2f,code,df2f
and exists(SELECT 1 FROM comp_technology WHERE comp_vers_id = pi1.value AND technology_type_id = 27621212 )
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
and NVL(pi82.value, 0) = 0 -- No TCO if these are tasks
and p.tc_direct_project_id not in (8943, 16411, 16412, 16413, 16406, 16399, 16407)-- exclude projects for fun and university challenges
Expand All @@ -334,8 +352,11 @@ INNER JOIN project_phase pp ON p.project_id = pp.project_id and pp.phase_type_id
INNER JOIN project_info pi12 ON p.project_id = pi12.project_id and pi12.project_info_type_id = 12 and pi12.value = 'Yes'
INNER JOIN project_info pi14 ON p.project_id = pi14.project_id and pi14.project_info_type_id = 14 and pi14.value = 'Open'
LEFT OUTER JOIN project_info pi82 ON pi82.project_id = p.project_id and pi82.project_info_type_id = 82
LEFT OUTER JOIN project_info pi1 ON pi1.project_id = p.project_id and pi1.project_info_type_id = 1
WHERE p.project_status_id = 1
and p.project_category_id in (37)
-- and p.project_category_id in (37)
and p.project_category_id in (9,13,37,38,39,40) --including bug hunt,test suits,Marathon,f2f,code,df2f
and exists(SELECT 1 FROM comp_technology WHERE comp_vers_id = pi1.value AND technology_type_id = 27621212 )
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
and NVL(pi82.value, 0) = 0 -- No TCO if these are tasks
and p.tc_direct_project_id not in (8943, 16411, 16412, 16413, 16406, 16399, 16407)-- exclude projects for fun and university challenges
Expand Down