/*****************************************************************************************
 *
 * CROSS COUNTRY          < OPTION 1 >          BXC: 3A/2A/1A      GXC: 3A/2A/1A
 *
 ****************************************************************************************/

/* 
 * Setup sanctioned activities
 */
DELETE FROM sanctioned_activities WHERE activity IN ("BXC", "GXC") AND school_year = 2018 AND division IN ("3A", "2A", "1A", "3A/2A/1A", "2A/1A");
INSERT INTO sanctioned_activities(school_year, season, division, activity, is_special_districts, first_event_at, last_event_at, final_event_at, created_at, updated_at) VALUES
(2018, "F", "3A/2A/1A", "BXC", 1, "2018-08-23 00:00:00", "2018-10-28 23:59:59", "2018-10-28 23:59:59", "2017-11-08 00:00:00", "2017-11-08 00:00:00"),
(2018, "F", "3A/2A/1A", "GXC", 1, "2018-08-23 00:00:00", "2018-10-28 23:59:59", "2018-10-28 23:59:59", "2017-11-08 00:00:00", "2017-11-08 00:00:00");

/*
 * GXC 3A/2A/1A SD-1
 */
UPDATE school_offerings SET league = "3A/2A/1A-SD1 (2018-2021)", division = "3A/2A/1A" WHERE school_year = 2018 AND activity = "GXC" AND
	school IN (225, 23, 103, 75, 112, 321, 157, 425, 15, 104, 338, 90, 485, 108, 119, 110, 277, 339, 435, 453, 117);

/*
 * GXC 3A/2A/1A SD-2
 */
UPDATE school_offerings SET league = "3A/2A/1A-SD2 (2018-2021)", division = "3A/2A/1A" WHERE school_year = 2018 AND activity = "GXC" AND
	school IN (441, 398, 417, 175, 356, 141, 63, 264, 20, 268, 191, 194, 140, 83);

/*
 * GXC 3A/2A/1A SD-3
 */
UPDATE school_offerings SET league = "3A/2A/1A-SD3 (2018-2021)", division = "3A/2A/1A" WHERE school_year = 2018 AND activity = "GXC" AND
	school IN (36, 273, 133, 5, 229, 106, 16, 170, 255, 207, 216, 261, 262, 122, 376, 432);

/*
 * GXC 3A/2A/1A SD-4
 */
UPDATE school_offerings SET league = "3A/2A/1A-SD4 (2018-2021)", division = "3A/2A/1A" WHERE school_year = 2018 AND activity = "GXC" AND
	school IN (215, 163, 240, 164, 47, 307, 41, 44, 64, 39, 254, 138, 275, 258, 101, 183, 228, 91, 271, 167);

/*
 * GXC 3A/2A/1A SD-5
 */
UPDATE school_offerings SET league = "3A/2A/1A-SD5 (2018-2021)", division = "3A/2A/1A" WHERE school_year = 2018 AND activity = "GXC" AND
	school IN (67, 192, 59, 199, 11, 220, 234, 19, 236, 563, 162, 241, 60, 196, 62, 404, 405, 136, 105, 61, 242, 73, 114, 190, 272, 21);

/*
 * GXC 3A/2A/1A SD-6
 */
UPDATE school_offerings SET league = "3A/2A/1A-SD6 (2018-2021)", division = "3A/2A/1A" WHERE school_year = 2018 AND activity = "GXC" AND
	school IN (18, 159, 78, 416, 3, 230, 174, 176, 169, 35, 181, 221, 25, 259, 49, 118, 71, 165, 349, 9);





/*
 * BXC 3A/2A/1A SD-1
 */
UPDATE school_offerings SET league = "3A/2A/1A-SD1 (2018-2021)", division = "3A/2A/1A" WHERE school_year = 2018 AND activity = "BXC" AND
	school IN (564, 225, 23, 103, 75, 112, 321, 157, 425, 15, 104, 338, 90, 485, 108, 119, 110, 277, 339, 435, 453, 117);

/*
 * BXC 3A/2A/1A SD-2
 */
UPDATE school_offerings SET league = "3A/2A/1A-SD2 (2018-2021)", division = "3A/2A/1A" WHERE school_year = 2018 AND activity = "BXC" AND
	school IN (195, 168, 441, 398, 417, 175, 356, 63, 264, 20, 268, 191, 194, 140, 83);

/*
 * BXC 3A/2A/1A SD-3
 */
UPDATE school_offerings SET league = "3A/2A/1A-SD3 (2018-2021)", division = "3A/2A/1A" WHERE school_year = 2018 AND activity = "BXC" AND
	school IN (36, 273, 133, 5, 229, 416, 141, 16, 170, 255, 207, 216, 261, 262, 122, 376);

/*
 * BXC 3A/2A/1A SD-4
 */
UPDATE school_offerings SET league = "3A/2A/1A-SD4 (2018-2021)", division = "3A/2A/1A" WHERE school_year = 2018 AND activity = "BXC" AND
	school IN (215, 163, 240, 164, 47, 307, 41, 44, 64, 39, 254, 138, 275, 258, 101, 71, 183, 228, 91, 271, 167);

/*
 * BXC 3A/2A/1A SD-5
 */
UPDATE school_offerings SET league = "3A/2A/1A-SD5 (2018-2021)", division = "3A/2A/1A" WHERE school_year = 2018 AND activity = "BXC" AND
	school IN (432, 347, 67, 192, 59, 199, 11, 106, 220, 234, 19, 236, 563, 162, 241, 60, 196, 62, 404, 405, 136, 105, 61, 242, 73, 114, 190, 272, 21);

/*
 * BXC 3A/2A/1A SD-6
 */
UPDATE school_offerings SET league = "3A/2A/1A-SD6 (2018-2021)", division = "3A/2A/1A" WHERE school_year = 2018 AND activity = "BXC" AND
	school IN (88, 18, 159, 78, 3, 230, 174, 176, 169, 35, 181, 221, 25, 259, 49, 118, 165, 349, 9);







/*****************************************************************************************
 *
 * CROSS COUNTRY          < OPTION 2 >          BXC: 3A, 2A/1A      GXC: 3A/2A/1A
 *
 ****************************************************************************************/

/* 
 * Setup sanctioned activities
 */
DELETE FROM sanctioned_activities WHERE activity IN ("BXC", "GXC") AND school_year = 2018 AND division IN ("3A", "2A", "1A", "3A/2A/1A", "2A/1A");
INSERT INTO sanctioned_activities(school_year, season, division, activity, is_special_districts, first_event_at, last_event_at, final_event_at, created_at, updated_at) VALUES
(2018, "F", "3A/2A/1A", "GXC", 1, "2018-08-23 00:00:00", "2018-10-28 23:59:59", "2018-10-28 23:59:59", "2017-11-08 00:00:00", "2017-11-08 00:00:00"),
(2018, "F", "3A", "BXC", 1, "2018-08-23 00:00:00", "2018-10-28 23:59:59", "2018-10-28 23:59:59", "2017-11-08 00:00:00", "2017-11-08 00:00:00"),
(2018, "F", "2A/1A", "BXC", 1, "2018-08-23 00:00:00", "2018-10-28 23:59:59", "2018-10-28 23:59:59", "2017-11-08 00:00:00", "2017-11-08 00:00:00");

/*
 * GXC 3A/2A/1A SD-1
 */
UPDATE school_offerings SET league = "3A/2A/1A-SD1 (2018-2021)", division = "3A/2A/1A" WHERE school_year = 2018 AND activity = "GXC" AND
	school IN (225, 23, 103, 75, 112, 321, 157, 425, 15, 104, 338, 90, 485, 108, 119, 110, 277, 339, 435, 453, 117);

/*
 * GXC 3A/2A/1A SD-2
 */
UPDATE school_offerings SET league = "3A/2A/1A-SD2 (2018-2021)", division = "3A/2A/1A" WHERE school_year = 2018 AND activity = "GXC" AND
	school IN (441, 398, 417, 175, 141, 356, 63, 264, 20, 268, 191, 194, 140, 83);

/*
 * GXC 3A/2A/1A SD-3
 */
UPDATE school_offerings SET league = "3A/2A/1A-SD3 (2018-2021)", division = "3A/2A/1A" WHERE school_year = 2018 AND activity = "GXC" AND
	school IN (36, 273, 133, 5, 416, 229, 16, 106, 170, 255, 207, 216, 261, 262, 122, 376, 432);

/*
 * GXC 3A/2A/1A SD-4
 */
UPDATE school_offerings SET league = "3A/2A/1A-SD4 (2018-2021)", division = "3A/2A/1A" WHERE school_year = 2018 AND activity = "GXC" AND
	school IN (215, 163, 240, 164, 47, 307, 41, 44, 64, 39, 254, 138, 275, 258, 101, 183, 228, 91, 271, 167);

/*
 * GXC 3A/2A/1A SD-5
 */
UPDATE school_offerings SET league = "3A/2A/1A-SD5 (2018-2021)", division = "3A/2A/1A" WHERE school_year = 2018 AND activity = "GXC" AND
	school IN (67, 192, 59, 199, 11, 220, 234, 19, 236, 563, 162, 241, 60, 196, 62, 404, 405, 136, 105, 61, 242, 73, 114, 190, 272, 21);

/*
 * GXC 3A/2A/1A SD-6
 */
UPDATE school_offerings SET league = "3A/2A/1A-SD6 (2018-2021)", division = "3A/2A/1A" WHERE school_year = 2018 AND activity = "GXC" AND
	school IN (18, 159, 78, 3, 230, 174, 176, 169, 35, 181, 221, 25, 259, 49, 118, 165, 71, 349, 9);





/*
 * Remove all previously 3A/2A/1A division teams in BXC
 */
UPDATE school_offerings SET division = NULL WHERE school_year = 2018 AND activity = 'BXC' AND division = '3A/2A/1A';

/*
 * BXC 3A SD-1
 */
UPDATE school_offerings SET league = "3A-SD1 (2018-2021)", division = "3A" WHERE school_year = 2018 AND activity = "BXC" AND
	school IN (225, 103, 417, 108, 119, 110, 277, 194);

/*
 * BXC 3A SD-2
 */
UPDATE school_offerings SET league = "3A-SD2 (2018-2021)", division = "3A" WHERE school_year = 2018 AND activity = "BXC" AND
	school IN (36, 273, 262, 63, 122, 268, 117, 140, 83);

/*
 * BXC 3A SD-3
 */
UPDATE school_offerings SET league = "3A-SD3 (2018-2021)", division = "3A" WHERE school_year = 2018 AND activity = "BXC" AND
	school IN (159, 78, 215, 3, 164, 183, 165, 349, 9);

/*
 * BXC 3A SD-4
 */
UPDATE school_offerings SET league = "3A-SD4 (2018-2021)", division = "3A" WHERE school_year = 2018 AND activity = "BXC" AND
	school IN (59, 404, 136, 47, 61, 73, 190);

/*
 * BXC 2A/1A SD-1
 */
UPDATE school_offerings SET league = "2A/1A-SD1 (2018-2021)", division = "2A/1A" WHERE school_year = 2018 AND activity = "BXC" AND
	school IN (23, 75, 321, 157, 104, 168, 441, 112, 321, 15, 338, 90, 485, 356, 339, 435, 453, 564, 191);

/*
 * BXC 2A/1A SD-2
 */
UPDATE school_offerings SET league = "2A/1A-SD2 (2018-2021)", division = "2A/1A" WHERE school_year = 2018 AND activity = "BXC" AND
	school IN (133, 5, 416, 229, 141, 16, 106, 170, 175, 255, 398, 207, 216, 261, 264, 20, 271, 228, 376, 195);

/*
 * BXC 2A/1A SD-3
 */
UPDATE school_offerings SET league = "2A/1A-SD3 (2018-2021)", division = "2A/1A" WHERE school_year = 2018 AND activity = "BXC" AND
	school IN (199, 347, 11, 220, 234, 19, 236, 563, 162, 241, 60, 62, 67, 405, 105, 242, 114, 192, 21, 272);

/*
 * BXC 2A/1A SD-4
 */
UPDATE school_offerings SET league = "2A/1A-SD4 (2018-2021)", division = "2A/1A" WHERE school_year = 2018 AND activity = "BXC" AND
	school IN (18, 230, 163, 240, 174, 176, 169, 35, 181, 307, 41, 44, 64, 39, 254, 221, 88, 138, 25, 275, 258, 101, 71, 259, 49, 118, 91, 432, 167);



