-- Updates promo for oranjes who only stated their orajisation to AX.
-- WARNING: this does not affect the display of their promotion anywhere. It will just allow them to attend events to both promotions.
-- Also they wiil not need to require a validation if they want to change promo on the site.

UPDATE  profile_education
   SET  grad_year = grad_year + 1
   WHERE  FIND_IN_SET('primary', flags)
          AND pid IN (29758,19172,104,20351,19184,19185,20289,18679,20748,20995,21165,21418,21251,25830,22816,24612,40570,40605,40846,40982,41342,41444,41813,41827,41957,41978);

-- Same as before but double orajisation.
UPDATE  profile_education
   SET  grad_year = grad_year + 2
 WHERE  FIND_IN_SET('primary', flags)
        AND pid IN (40616,18399);

-- Updates promo for EV when were are mistaken and AX is right.

UPDATE  profile_education
   SET  entry_year = entry_year - 1
 WHERE  FIND_IN_SET('primary', flags)
        AND pid IN (19312,20689,23292,24028,25733,26772,34164,34167,34169,34171,34172,34312,40625,24775,34317,34318,34321,34324,34329,34330,34473,10612,24025,24099,24250,24435,24768,24901,34588,34595,34602,34604,34607,20371,20925,10713,21713,21744,21787,24189,24927,25395,25832,26976,34724,34726,34727,34731,34735,34739,34743,34745,34747,26671,21577,21722,23692,25598,34857,34859,34860,34863,34864,34866,34868,34873,34874,34876,34877,19644,26663,23460,24744,24751,24917,25134,25458,26058,34994,34995,34997,34998,35000,35003,35005,35006,35009,35014,35016,35018,24132,10840,10845,10876,19979,20025,20384,20922,21355,22733,25558,26580,35126,35127,35131,35135,35140,35143,35144,35146,35148,26706,20928,17238,18589,19404,19553,21718,22723,25184,25804,26652,35262,35263,35269,35270,35271,35272,35274,35279,35281,35283,11003,17550,17850,17995,22370,23965,24012,26667,24820,25900,26462,35391,35392,35393,35394,35396,35397,35398,35399,35402,35403,35405,35407,35409,35412,35413,17868,18560,19773,21189,21187,21786,22054,23524,24116,24354,26651,35487,35488,35493,35496,35497,35499,35500,35507,11080,11141,19079,21481,25229,25831,35618,35620,35621,35622,35623,35626,35628,35630,11190,11194,11206,11233,11286,17538,19814,21849,26421,26577,35719,35722,35724,35726,35729,35730,35731,35734,11443,17542,17552,17841,19357,19474,20152,22681,23262,24654,24974,25098,26644,26674,35813,35814,35817,35818,35820,35821,20157,11476,18161,19591,19992,20868,22337,24130,25072,25658,25780,26458,26420,26635,26471,26456,26525,35907,35909,35910,35912,35913,35915,35916,35918,35919,18904,19823,19887,24793,25114,25142,26004,26578,26544,40627,40628,40629,40630,18212,24774,18055,40617,41009,35268,17692);
UPDATE  profile_education
   SET  grad_year = entry_year + 3
 WHERE  FIND_IN_SET('primary', flags)
        AND pid IN (19312,20689,23292,24028,25733,26772,34164,34167,34169,34171,34172,34312,40625,24775,34317,34318,34321,34324,34329,34330,34473,10612,24025,24099,24250,24435,24768,24901,34588,34595,34602,34604,34607,20371,20925,10713,21713,21744,21787,24189,24927,25395,25832,26976,34724,34726,34727,34731,34735,34739,34743,34745,34747,26671,21577,21722,23692,25598,34857,34859,34860,34863,34864,34866,34868,34873,34874,34876,34877,19644,26663,23460,24744,24751,24917,25134,25458,26058,34994,34995,34997,34998,35000,35003,35005,35006,35009,35014,35016,35018,24132,10840,10845,10876,19979,20025,20384,20922,21355,22733,25558,26580,35126,35127,35131,35135,35140,35143,35144,35146,35148,26706,20928,17238,18589,19404,19553,21718,22723,25184,25804,26652,35262,35263,35269,35270,35271,35272,35274,35279,35281,35283,11003,17550,17850,17995,22370,23965,24012,26667,24820,25900,26462,35391,35392,35393,35394,35396,35397,35398,35399,35402,35403,35405,35407,35409,35412,35413,17868,18560,19773,21189,21187,21786,22054,23524,24116,24354,26651,35487,35488,35493,35496,35497,35499,35500,35507,11080,11141,19079,21481,25229,25831,35618,35620,35621,35622,35623,35626,35628,35630,11190,11194,11206,11233,11286,17538,19814,21849,26421,26577,35719,35722,35724,35726,35729,35730,35731,35734,11443,17542,17552,17841,19357,19474,20152,22681,23262,24654,24974,25098,26644,26674,35813,35814,35817,35818,35820,35821,20157,11476,18161,19591,19992,20868,22337,24130,25072,25658,25780,26458,26420,26635,26471,26456,26525,35907,35909,35910,35912,35913,35915,35916,35918,35919,18904,19823,19887,24793,25114,25142,26004,26578,26544,40627,40628,40629,40630,18212,24774,18055,40617,41009,35268,17692);
    UPDATE  profile_display
INNER JOIN  profile_education ON (profile_display.pid = profile_education.pid AND FIND_IN_SET('primary', profile_education.flags))
       SET  promo = CONCAT('X', profile_education.entry_year)
     WHERE  FIND_IN_SET('primary', flags)
            AND profile_education.pid IN (19312,20689,23292,24028,25733,26772,34164,34167,34169,34171,34172,34312,40625,24775,34317,34318,34321,34324,34329,34330,34473,10612,24025,24099,24250,24435,24768,24901,34588,34595,34602,34604,34607,20371,20925,10713,21713,21744,21787,24189,24927,25395,25832,26976,34724,34726,34727,34731,34735,34739,34743,34745,34747,26671,21577,21722,23692,25598,34857,34859,34860,34863,34864,34866,34868,34873,34874,34876,34877,19644,26663,23460,24744,24751,24917,25134,25458,26058,34994,34995,34997,34998,35000,35003,35005,35006,35009,35014,35016,35018,24132,10840,10845,10876,19979,20025,20384,20922,21355,22733,25558,26580,35126,35127,35131,35135,35140,35143,35144,35146,35148,26706,20928,17238,18589,19404,19553,21718,22723,25184,25804,26652,35262,35263,35269,35270,35271,35272,35274,35279,35281,35283,11003,17550,17850,17995,22370,23965,24012,26667,24820,25900,26462,35391,35392,35393,35394,35396,35397,35398,35399,35402,35403,35405,35407,35409,35412,35413,17868,18560,19773,21189,21187,21786,22054,23524,24116,24354,26651,35487,35488,35493,35496,35497,35499,35500,35507,11080,11141,19079,21481,25229,25831,35618,35620,35621,35622,35623,35626,35628,35630,11190,11194,11206,11233,11286,17538,19814,21849,26421,26577,35719,35722,35724,35726,35729,35730,35731,35734,11443,17542,17552,17841,19357,19474,20152,22681,23262,24654,24974,25098,26644,26674,35813,35814,35817,35818,35820,35821,20157,11476,18161,19591,19992,20868,22337,24130,25072,25658,25780,26458,26420,26635,26471,26456,26525,35907,35909,35910,35912,35913,35915,35916,35918,35919,18904,19823,19887,24793,25114,25142,26004,26578,26544,40627,40628,40629,40630,18212,24774,18055,40617,41009,35268,17692);

-- vim:set syntax=mysql:
