Prepares merge
authorStéphane Jacob <sj@m4x.org>
Wed, 13 Oct 2010 18:05:06 +0000 (20:05 +0200)
committerStéphane Jacob <sj@m4x.org>
Fri, 15 Oct 2010 11:23:34 +0000 (13:23 +0200)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
upgrade/1.0.1/15_merge_issues.sql [new file with mode: 0644]
upgrade/1.0.1/16_promo.sql [new file with mode: 0644]
upgrade/merge-0.0.1/02_ax_data.sql [deleted file]

diff --git a/upgrade/1.0.1/15_merge_issues.sql b/upgrade/1.0.1/15_merge_issues.sql
new file mode 100644 (file)
index 0000000..b96baf0
--- /dev/null
@@ -0,0 +1,12 @@
+DROP TABLE IF EXISTS profile_merge_issues;
+CREATE TABLE IF NOT EXISTS profile_merge_issues (
+  pid INT(11) UNSIGNED DEFAULT NULL,
+  issues SET('name', 'job', 'address', 'promo', 'deathdate', 'phone', 'education') DEFAULT NULL,
+  entry_year_ax INT(4) DEFAULT NULL,
+  deathdate_ax DATE DEFAULT NULL,
+  name VARCHAR(255) DEFAULT NULL,
+  name_type TINYINT(2) UNSIGNED DEFAULT NULL,
+  PRIMARY KEY (pid)
+) ENGINE=InnoDB, CHARSET=utf8;
+
+-- vim:set syntax=mysql:
diff --git a/upgrade/1.0.1/16_promo.sql b/upgrade/1.0.1/16_promo.sql
new file mode 100644 (file)
index 0000000..e77eb91
--- /dev/null
@@ -0,0 +1,32 @@
+-- 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:
diff --git a/upgrade/merge-0.0.1/02_ax_data.sql b/upgrade/merge-0.0.1/02_ax_data.sql
deleted file mode 100644 (file)
index 1fc96e8..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-CREATE TABLE IF NOT EXISTS alumni_data (
-  uid INT(11) NOT NULL,
-  matricule_ax CHAR(8) UNSIGNED NOT NULL,
-  login_ax VARCHAR(15) NOT NULL,
-  passwd_ax INT(11) UNSIGNED DEFAULT NULL,
-  promo_type ENUM('', 'A', 'B', 'C', 'N', 'S') NOT NULL,
-  membership_type ENUM('', '*', 'F', 'FB', 'P', 'PB', 'T', 'TB', 'TA') NOT NULL,
-  salutation ENUM('', '.', 'M', 'MME', 'MLLE') NOT NULL,
-  last_dues_paid_year INT(4) UNSIGNED NOT NULL,
-  represents ENUM('', 'K', 'DE') NOT NULL,
-  checked TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
-  PRIMARY KEY (uid)
-) CHARSET=utf8;
-
-
-INSERT INTO  alumni_data (uid, matricule_ax, login_ax, passwd_ax, promo_type, membership_type,
-             salutation, last_dues_paid_year, represents, checked)
-     SELECT  u.user_id, u.matricule_ax, f.Login, f.Password, f.Groupe_promo,
-             f.Type_membre, f.Civilite, f.annee_dernCot, f.Representant, 0
-       FROM  fusionax_anciens AS f
- INNER JOIN  auth_user_md5    AS u ON (f.id_ancien = u.matricule_ax);
-
--- vim:set syntax=mysql: