Skip to content

Changes to TCO Scripts to exclude certain projects #20

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 9 commits into from
Apr 5, 2018
Merged
Show file tree
Hide file tree
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
22 changes: 22 additions & 0 deletions common_oltp/02_common_oltp_data_setup.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13527,6 +13527,28 @@ INSERT INTO 'informix'.security_groups(group_id,description,create_user_id) VALU
INSERT INTO 'informix'.security_groups(group_id,description,create_user_id) VALUES (208, 'Triton', 14882871);
INSERT INTO 'informix'.security_groups(group_id,description,create_user_id) VALUES (217, 'Liquid Community', 132456);
INSERT INTO 'informix'.security_groups(group_id,description,create_user_id) VALUES (101, 'VMManager', NULL);
INSERT INTO 'informix'.security_groups ('group_id', 'description', 'create_user_id', 'challenge_group_ind') VALUES (20000018, 'Quartz Energy MVA Dev', 8547899, 1);
INSERT INTO 'informix'.security_groups ('group_id', 'description', 'create_user_id', 'challenge_group_ind') VALUES (20000017, 'Kohls Testing Team', 8547899, 1);
INSERT INTO 'informix'.security_groups ('group_id', 'description', 'create_user_id', 'challenge_group_ind') VALUES (20000016, 'Wipro - Future Employees', 8547899, 1);
INSERT INTO 'informix'.security_groups ('group_id', 'description', 'create_user_id', 'challenge_group_ind') VALUES (20000015, 'Cognitive', 8547899, 1);
INSERT INTO 'informix'.security_groups ('group_id', 'description', 'create_user_id', 'challenge_group_ind') VALUES (20000014, 'Hide Challenges', 8547899, 1);
INSERT INTO 'informix'.security_groups ('group_id', 'description', 'create_user_id', 'challenge_group_ind') VALUES (20000013, 'Veterans', 8547899, 1);
INSERT INTO 'informix'.security_groups ('group_id', 'description', 'create_user_id', 'challenge_group_ind') VALUES (20000012, 'QA - Public', 8547899, 1);
INSERT INTO 'informix'.security_groups ('group_id', 'description', 'create_user_id', 'challenge_group_ind') VALUES (20000011, 'TG_CaptialOne_MapMigration', 8547899, 1);
INSERT INTO 'informix'.security_groups ('group_id', 'description', 'create_user_id', 'challenge_group_ind') VALUES (20000010, 'Blockchain', 8547899, 1);
INSERT INTO 'informix'.security_groups ('group_id', 'description', 'create_user_id', 'challenge_group_ind') VALUES (20000009, 'Capital One - EDS', 8547899, 1);
INSERT INTO 'informix'.security_groups ('group_id', 'description', 'create_user_id', 'challenge_group_ind') VALUES (20000008, 'Capital One - Cards', 8547899, 1);
INSERT INTO 'informix'.security_groups ('group_id', 'description', 'create_user_id', 'challenge_group_ind') VALUES (20000007, 'Capital One', 8547899, 1);
INSERT INTO 'informix'.security_groups ('group_id', 'description', 'create_user_id', 'challenge_group_ind') VALUES (20000006, 'SRMX', 8547899, 1);
INSERT INTO 'informix'.security_groups ('group_id', 'description', 'create_user_id', 'challenge_group_ind') VALUES (20000005, 'Wipro - Holmes', 8547899, 1);
INSERT INTO 'informix'.security_groups ('group_id', 'description', 'create_user_id', 'challenge_group_ind') VALUES (20000004, 'Wipro - QAAS', 8547899, 1);
INSERT INTO 'informix'.security_groups ('group_id', 'description', 'create_user_id', 'challenge_group_ind') VALUES (20000003, 'TC - Taskforce', 8547899, 1);
INSERT INTO 'informix'.security_groups ('group_id', 'description', 'create_user_id', 'challenge_group_ind') VALUES (20000002, 'BAE', 8547899, 1);
INSERT INTO 'informix'.security_groups ('group_id', 'description', 'create_user_id', 'challenge_group_ind') VALUES (20000001, 'Topcoder Prod Dev', 8547899, 1);
INSERT INTO 'informix'.security_groups ('group_id', 'description', 'create_user_id', 'challenge_group_ind') VALUES (20000000, 'Wipro - All', 8547899, 1);



INSERT INTO 'informix'.preference_group_lu(preference_group_id,preference_group_desc,sort_order) VALUES (1, 'User Card Preferences', NULL);
INSERT INTO 'informix'.preference_group_lu(preference_group_id,preference_group_desc,sort_order) VALUES (2, 'Contract Work', 1);
INSERT INTO 'informix'.preference_group_lu(preference_group_id,preference_group_desc,sort_order) VALUES (3, 'Permanent Position', 2);
Expand Down
44 changes: 31 additions & 13 deletions tco_setup/tco18_eligible_contests.sql
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ WHERE p.project_status_id = 1
and p.project_id not in (select ce.contest_id from contest_eligibility ce)
and NVL(pi82.value, 0) = 0 -- No TCO if these are tasks
and (select lower(value) from project_info where project_id = p.project_id and project_info_type_id = 6) not like 'ibm cognitive%' -- exclude IBM Cognitive Community Segment
and p.project_id not in (30059771) -- exceptions to exclude
-- and mod(p.project_id, 2) = 0;
and 1=1;

Expand All @@ -40,6 +41,7 @@ WHERE p.project_status_id = 1
and p.project_id not in (select ce.contest_id from contest_eligibility ce)
and NVL(pi82.value, 0) = 0 -- No TCO if these are tasks
and (select lower(value) from project_info where project_id = p.project_id and project_info_type_id = 6) not like 'ibm cognitive%' -- exclude IBM Cognitive Community Segment
and p.project_id not in (30059771) -- exceptions to exclude
-- and mod(p.project_id, 2) = 0;
and 1=1;

Expand All @@ -49,7 +51,7 @@ insert into contest_project_xref
SELECT 655, p.project_id, current
FROM project p
INNER JOIN project_phase pp ON p.project_id = pp.project_id and pp.phase_type_id = 1 and
pp.actual_start_time >= '2018-01-01 00:00:00.000' and pp.actual_start_time < '2018-05-01 00:00:00.000'
pp.actual_start_time >= '2018-02-01 00:00:00.000' and pp.actual_start_time < '2018-05-01 00:00:00.000'
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 pi13 ON p.project_id = pi13.project_id and pi13.project_info_type_id = 13 and (pi13.value = 'Yes' or p.project_category_id = 39) -- Code challenges are included even if not rated
INNER JOIN project_info pi14 ON p.project_id = pi14.project_id and pi14.project_info_type_id = 14 and pi14.value = 'Open'
Expand All @@ -60,7 +62,9 @@ WHERE p.project_status_id = 1
and p.project_id not in (select ce.contest_id from contest_eligibility ce)
and NVL(pi82.value, 0) = 0 -- No TCO if these are tasks
and (select lower(value) from project_info where project_id = p.project_id and project_info_type_id = 6) not like 'ibm cognitive%' -- exclude IBM Cognitive Community Segment
and p.project_id not in (30057468, 30057606); -- exclude specific challenges
and p.project_id not in (30057468, 30057606) -- exclude specific challenges
and p.tc_direct_project_id not in (16411, 16412, 16413, 16406, 16399, 16407) -- exclude projects for fun and university challenges
and 1=1;
-- and mod(p.project_id, 2) = 0;

-- Stage 4
Expand All @@ -79,7 +83,9 @@ WHERE p.project_status_id = 1
and p.project_id not in (select ce.contest_id from contest_eligibility ce)
and NVL(pi82.value, 0) = 0 -- No TCO if these are tasks
and (select lower(value) from project_info where project_id = p.project_id and project_info_type_id = 6) not like 'ibm cognitive%' -- exclude IBM Cognitive Community Segment
and p.project_id not in (30057968); -- exclude specific challenges
and p.project_id not in (30057968) -- exclude specific challenges
and p.tc_direct_project_id not in (16411, 16412, 16413, 16406, 16399, 16407)-- exclude projects for fun and university challenges
and 1 = 1;
-- and mod(p.project_id, 2) = 0;


Expand Down Expand Up @@ -129,7 +135,7 @@ insert into contest_project_xref
SELECT 650, p.project_id, current
FROM project p
INNER JOIN project_phase pp ON p.project_id = pp.project_id and pp.phase_type_id = 1 and
pp.actual_start_time >= '2018-01-01 00:00:00.000' and pp.actual_start_time < '2018-05-01 00:00:00.000'
pp.actual_start_time >= '2018-02-01 00:00:00.000' and pp.actual_start_time < '2018-05-01 00:00:00.000'
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 pi13 ON p.project_id = pi13.project_id and pi13.project_info_type_id = 13 and pi13.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'
Expand All @@ -139,7 +145,9 @@ WHERE p.project_status_id = 1
and p.project_id not in (select project_id from contest_project_xref where contest_id in (650, 583)) -- make sure we exclude from tco
and p.project_id not in (select ce.contest_id from contest_eligibility ce)
and NVL(pi82.value, 0) = 0 -- No TCO if these are tasks
and (select lower(value) from project_info where project_id = p.project_id and project_info_type_id = 6) not like 'ibm cognitive%'; -- exclude IBM Cognitive Community Segment
and (select lower(value) from project_info where project_id = p.project_id and project_info_type_id = 6) not like 'ibm cognitive%' -- exclude IBM Cognitive Community Segment
and p.tc_direct_project_id not in (16411, 16412, 16413, 16406, 16399, 16407)-- exclude projects for fun and university challenges
and 1 = 1;
-- and mod(p.project_id, 2) = 0;

-- Stage 4
Expand All @@ -157,7 +165,9 @@ WHERE p.project_status_id = 1
and p.project_id not in (select project_id from contest_project_xref where contest_id in (651, 583)) -- make sure we exclude from tco
and p.project_id not in (select ce.contest_id from contest_eligibility ce)
and NVL(pi82.value, 0) = 0 -- No TCO if these are tasks
and (select lower(value) from project_info where project_id = p.project_id and project_info_type_id = 6) not like 'ibm cognitive%'; -- exclude IBM Cognitive Community Segment
and (select lower(value) from project_info where project_id = p.project_id and project_info_type_id = 6) not like 'ibm cognitive%' -- exclude IBM Cognitive Community Segment
and p.tc_direct_project_id not in (16411, 16412, 16413, 16406, 16399, 16407)-- exclude projects for fun and university challenges
and 1 = 1;
-- and mod(p.project_id, 2) = 0;


Expand Down Expand Up @@ -205,7 +215,7 @@ insert into contest_project_xref
SELECT 645, p.project_id, current
FROM project p
INNER JOIN project_phase pp ON p.project_id = pp.project_id and pp.phase_type_id = 1 and
pp.actual_start_time >= '2018-01-01 00:00:00.000' and pp.actual_start_time < '2018-05-01 00:00:00.000'
pp.actual_start_time >= '2018-02-01 00:00:00.000' and pp.actual_start_time < '2018-05-01 00:00:00.000'
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
Expand All @@ -215,7 +225,9 @@ WHERE p.project_status_id = 1
and p.project_id not in (select ce.contest_id from contest_eligibility ce)
and NVL(pi82.value, 0) = 0 -- No TCO if these are tasks
and (select lower(value) from project_info where project_id = p.project_id and project_info_type_id = 6) not like 'ibm cognitive%' -- exclude IBM Cognitive Community Segment
and p.project_id not in (30057516); -- exclude specific challenges
and p.project_id not in (30057516) -- exclude specific challenges
and p.tc_direct_project_id not in (16411, 16412, 16413, 16406, 16399, 16407)-- exclude projects for fun and university challenges
and 1 = 1;
-- and mod(p.project_id, 2) = 0;


Expand All @@ -233,7 +245,10 @@ WHERE p.project_status_id = 1
and p.project_id not in (select project_id from contest_project_xref where contest_id in (646, 583)) -- make sure we exclude from tco
and p.project_id not in (select ce.contest_id from contest_eligibility ce)
and NVL(pi82.value, 0) = 0 -- No TCO if these are tasks
and (select lower(value) from project_info where project_id = p.project_id and project_info_type_id = 6) not like 'ibm cognitive%'; -- exclude IBM Cognitive Community Segment
and (select lower(value) from project_info where project_id = p.project_id and project_info_type_id = 6) not like 'ibm cognitive%' -- exclude IBM Cognitive Community Segment
and p.tc_direct_project_id not in (16411, 16412, 16413, 16406, 16399, 16407) -- exclude projects for fun and university challenges
and 1 = 1;

-- and mod(p.project_id, 2) = 0;


Expand Down Expand Up @@ -280,7 +295,7 @@ insert into contest_project_xref
SELECT 640, p.project_id, current
FROM project p
INNER JOIN project_phase pp ON p.project_id = pp.project_id and pp.phase_type_id = 1 and
pp.actual_start_time >= '2018-01-01 00:00:00.000' and pp.actual_start_time < '2018-05-01 00:00:00.000'
pp.actual_start_time >= '2018-02-01 00:00:00.000' and pp.actual_start_time < '2018-05-01 00:00:00.000'
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
Expand All @@ -289,8 +304,10 @@ WHERE p.project_status_id = 1
and p.project_id not in (select project_id from contest_project_xref where contest_id in (640, 583)) -- make sure we exclude from tco
and p.project_id not in (select ce.contest_id from contest_eligibility ce)
and NVL(pi82.value, 0) = 0 -- No TCO if these are tasks
and (select lower(value) from project_info where project_id = p.project_id and project_info_type_id = 6) not like 'ibm cognitive%'; -- exclude IBM Cognitive Community Segment
and (select lower(value) from project_info where project_id = p.project_id and project_info_type_id = 6) not like 'ibm cognitive%' -- exclude IBM Cognitive Community Segment
-- and mod(p.project_id, 2) = 0;
and p.tc_direct_project_id not in (16411, 16412, 16413, 16406, 16399, 16407)-- exclude projects for fun and university challenges
and 1 = 1;

-- Stage 4
insert into contest_project_xref
Expand All @@ -307,6 +324,7 @@ WHERE p.project_status_id = 1
and p.project_id not in (select ce.contest_id from contest_eligibility ce)
and NVL(pi82.value, 0) = 0 -- No TCO if these are tasks
and p.project_id not in (30057968,30057832,30057829,30057831) -- exclude specific challenges
and (select lower(value) from project_info where project_id = p.project_id and project_info_type_id = 6) not like 'ibm cognitive%'; -- exclude IBM Cognitive Community Segment
and (select lower(value) from project_info where project_id = p.project_id and project_info_type_id = 6) not like 'ibm cognitive%' -- exclude IBM Cognitive Community Segment
-- and mod(p.project_id, 2) = 0;

and p.tc_direct_project_id not in (16411, 16412, 16413, 16406, 16399, 16407)-- exclude projects for fun and university challenges
and 1 = 1;
2 changes: 2 additions & 0 deletions tcs_catalog/02_tcs_catalog_data_setup.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1346,6 +1346,8 @@ INSERT INTO 'informix'.project_info_type_lu(project_info_type_id,name,descriptio
INSERT INTO 'informix'.project_info_type_lu(project_info_type_id,name,description,create_user,create_date,modify_user,modify_date) VALUES (83, 'Product SKU', 'Product SKU', 'System', CURRENT, 'System', CURRENT);
INSERT INTO "informix".project_info_type_lu(project_info_type_id,name,description,create_user,create_date,modify_user,modify_date) VALUES (84, 'Environment', 'Environment', 'System', CURRENT, 'System', CURRENT);
INSERT INTO "informix".project_info_type_lu(project_info_type_id,name,description,create_user,create_date,modify_user,modify_date) VALUES (85, 'Code Repo', 'Code Repo', 'System', CURRENT, 'System', CURRENT);
INSERT INTO "informix".project_info_type_lu(project_info_type_id,name,description,create_user,create_date,modify_user,modify_date) VALUES (86, 'Marathon Match Contest Id', 'Marathon Match Contest Id', 'System', CURRENT, 'System', CURRENT);
INSERT INTO "informix".project_info_type_lu(project_info_type_id,name,description,create_user,create_date,modify_user,modify_date) VALUES (87, 'Marathon Match Type', 'Marathon Match Type', 'System', CURRENT, 'System', CURRENT);

INSERT INTO 'informix'.phase_status_lu(phase_status_id,name,description,create_user,create_date,modify_user,modify_date) VALUES (1, 'Scheduled', 'Scheduled', 'System', '2006-11-02 20:14:24.000', 'System', '2006-11-02 20:14:24.000');
INSERT INTO 'informix'.phase_status_lu(phase_status_id,name,description,create_user,create_date,modify_user,modify_date) VALUES (2, 'Open', 'Open', 'System', '2006-11-02 20:14:24.000', 'System', '2006-11-02 20:14:24.000');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SELECT tdp.project_id as direct_project_id, tdp.name as direct_project_name, p.project_id as billing_account_id, p.name as billing_account_name,
c.client_id as client_id, c.name as client_name
c.client_id as client_id, c.name as client_name, p.active as active, p.end_date as end_date
FROM tc_direct_project tdp, corporate_oltp:direct_project_account dpa, tt_project p, tt_client_project cp, tt_client c
WHERE tdp.project_id = dpa.project_id
AND dpa.billing_account_id = p.project_id
AND p.project_id = cp.project_id
AND cp.client_id = c.client_id
AND cp.client_id = c.client_id