Updates and improves code for Xorg/AX directory merge.
authorStéphane Jacob <sj@m4x.org>
Tue, 28 Sep 2010 21:22:29 +0000 (23:22 +0200)
committerStéphane Jacob <sj@m4x.org>
Fri, 8 Oct 2010 14:53:07 +0000 (16:53 +0200)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
23 files changed:
modules/fusionax.php
modules/fusionax/Activites.sql
modules/fusionax/Adresses.sql
modules/fusionax/Anciens.sql
modules/fusionax/Entreprises.sql
modules/fusionax/Formations.sql
modules/fusionax/formation.pl
modules/fusionax/import-ax.sh [deleted file]
templates/fusionax/deceased.tpl
templates/fusionax/ids.tpl
templates/fusionax/idsMissingInAx.tpl
templates/fusionax/idsMissingInXorg.tpl
templates/fusionax/idswrongInXorg.tpl
templates/fusionax/import.tpl
templates/fusionax/index.tpl
templates/fusionax/listFusion.tpl
templates/fusionax/promo.tpl
templates/fusionax/view.tpl
upgrade/1.0.1/14_ax_id.sql [new file with mode: 0644]
upgrade/merge-0.0.1/000_1920.sql [deleted file]
upgrade/merge-0.0.1/00_names.sql [deleted file]
upgrade/merge-0.0.1/04_nationalities.sql [deleted file]
upgrade/merge-0.0.1/05_check_nationalities.sql [deleted file]

index ac22a02..e5d853d 100644 (file)
  ***************************************************************************/
 
 /**
- * @brief Module to merge data from AX database
+ * Module to merge data from AX database: this will only be used once on
+ * production site and should be removed afterwards.
  *
  * Module to import data from another database of alumni that had
  * different schemas. The organization that used this db is called AX
  * hence the name of this module.
  *
- * Datas are stored in an external server and you need a private key
- * to connect to their server.
+ * Datas are stored in an export file.
  */
 class FusionAxModule extends PLModule
 {
-    function __construct()
-    {
-    }
-
     function handlers()
     {
         return array(
@@ -50,68 +46,63 @@ class FusionAxModule extends PLModule
 
     function handler_index(&$page)
     {
-        $globals = Platal::globals();
-
         $page->changeTpl('fusionax/index.tpl');
         $page->assign('xorg_title', 'Polytechnique.org - Fusion des annuaires');
-        if (isset($globals->fusionax) && isset($globals->fusionax->LastUpdate)) {
-            $page->assign('lastimport', date("d-m-Y", $globals->fusionax->LastUpdate));
-        }
     }
 
     /** Import de l'annuaire de l'AX depuis l'export situé dans le home de jacou */
-    function handler_import(&$page, $action = 'index', $fileSQL = '')
+    function handler_import(&$page, $action = 'index', $file = '')
     {
-        $globals = Platal::globals();
-
         if ($action == 'index') {
             $page->changeTpl('fusionax/import.tpl');
-            if (isset($globals->fusionax) && isset($globals->fusionax->LastUpdate)) {
-                $page->assign(
-                    'lastimport',
-                    "le " . date("d/m/Y à H:i", $globals->fusionax->LastUpdate));
-            }
             return;
         }
 
         // toutes les actions sont faites en ajax en utilisant jquery
-        header("Content-type: text/javascript; charset=utf-8");
+        header('Content-type: text/javascript; charset=utf-8');
 
         // log des actions
         $report = array();
 
-        // création d'un fichier temporaire si nécessaire
-        if (Env::has('tmpdir')) {
-            $tmpdir = Env::v('tmpdir');
-        } else {
-            $tmpdir = tempnam('/tmp', 'fusionax');
-            unlink($tmpdir);
-            mkdir($tmpdir);
-            chmod($tmpdir, 0700);
-        }
-
         $modulepath = realpath(dirname(__FILE__) . '/fusionax/') . '/';
-        $olddir = getcwd();
-        chdir($tmpdir);
+        $spoolpath = realpath(dirname(__FILE__) . '/../spool/fusionax/') . '/';
 
         if ($action == 'launch') {
-            // séparation de l'archive en fichiers par tables
-            exec($modulepath . 'import-ax.sh', $report);
-            $report[] = 'Fichier parsé.';
-            $report[] = 'Import dans la base en cours...';
-            $next = 'integrateSQL';
+            if ($file == '') {
+                $report[] = 'Nom de fichier non renseigné.';
+            } elseif (!file_exists(dirname(__FILE__) . '/../spool/fusionax/' . $file)) {
+                $report[] = 'Le fichier ne se situe pas au bon endroit.';
+            } else {
+                // séparation de l'archive en fichiers par tables
+                $file = $spoolpath . $file;
+                // Removes master and doctorate students
+                exec('grep -v "^[A-Z]\{2\}.[0-9]\{4\}[MD][0-9]\{3\}" ' . $file . ' > ' . $file . '.tmp');
+                exec('mv -f ' . $file . '.tmp ' . $file);
+                // Split export into specialised files
+                exec('grep "^AD" ' . $file . ' > ' . $spoolpath . 'Adresses.txt');
+                exec('grep "^AN" ' . $file . ' > ' . $spoolpath . 'Anciens.txt');
+                exec('grep "^FO" ' . $file . ' > ' . $spoolpath . 'Formations.txt');
+                exec('grep "^AC" ' . $file . ' > ' . $spoolpath . 'Activites.txt');
+                exec('grep "^EN" ' . $file . ' > ' . $spoolpath . 'Entreprises.txt');
+                exec($modulepath . 'formation.pl');
+                exec('mv -f ' . $spoolpath . 'Formations_out.txt ' . $spoolpath . 'Formations.txt');
+                $report[] = 'Fichier parsé.';
+                $report[] = 'Import dans la base en cours...';
+                $next = 'integrateSQL';
+            }
         } elseif ($action == 'integrateSQL') {
             // intégration des données dans la base MySQL
             // liste des fichiers sql à exécuter
             $filesSQL = array(
-                'Activites.sql',
-                'Adresses.sql',
-                'Anciens.sql',
-                'Formations.sql',
-                'Entreprises.sql');
-            if ($fileSQL != '') {
+                0 => 'Activites.sql',
+                1 => 'Adresses.sql',
+                2 => 'Anciens.sql',
+                3 => 'Formations.sql',
+                4 => 'Entreprises.sql'
+            );
+            if ($file != '') {
                 // récupère le contenu du fichier sql
-                $queries = explode(';', file_get_contents($modulepath . $fileSQL));
+                $queries = explode(';', file_get_contents($modulepath . $filesSQL[$file]));
                 foreach ($queries as $q) {
                     if (trim($q)) {
                         // coupe le fichier en requêtes individuelles
@@ -122,74 +113,139 @@ class FusionAxModule extends PLModule
                             $report[] = addslashes($l);
                         }
                         // exécute la requête
-                        XDB::execute($q);
+                        XDB::execute(str_replace('{?}', $spoolpath, $q));
                     }
                 }
                 // trouve le prochain fichier à exécuter
-                $trans = array_flip($filesSQL);
-                $nextfile = $trans[$fileSQL] + 1;
+                $nextfile = $file + 1;
             } else {
                 $nextfile = 0;
             }
-            if (!isset($filesSQL[$nextfile])) {
-                // tous les fichiers ont été exécutés, on passe à l'étape
-                // suivante
-                $next = 'clean';
+            if ($nextfile > 4) {
+                // tous les fichiers ont été exécutés, on passe à l'étape suivante
+                $next = 'adds1920';
             } else {
                 // on passe au fichier suivant
-                $next = 'integrateSQL/' . $filesSQL[$nextfile];
+                $next = 'integrateSQL/' . $nextfile;
+            }
+        } elseif ($action == 'adds1920') {
+            // Adds promotion 1920 from AX db.
+            $report[] = 'Ajout de la promotion 1920';
+            $res = XDB::iterator('SELECT  prenom, Nom_complet, ax_id
+                                    FROM  fusionax_anciens
+                                   WHERE  promotion_etude = 1920;');
+
+            $nameTypes = DirEnum::getOptions(DirEnum::NAMETYPES);
+            $nameTypes = array_flip($nameTypes);
+            $eduSchools = DirEnum::getOptions(DirEnum::EDUSCHOOLS);
+            $eduSchools = array_flip($eduSchools);
+            $eduDegrees = DirEnum::getOptions(DirEnum::EDUDEGREES);
+            $eduDegrees = array_flip($eduDegrees);
+            $degreeid = $eduDegrees[Profile::DEGREE_X];
+            $entry_year = 1920;
+            $grad_year = 1923;
+            $promo = 'X1920';
+            $sex = PlUser::GENDER_MALE;
+            $xorgId = 19200000;
+            $type = 'x';
+
+            while (list($firstname, $lastname, $ax_id) = $res->next()) {
+                $hrid = self::getHrid($firstname, $lastname, $promo);
+                $res1 = XDB::query('SELECT  COUNT(*)
+                                      FROM  accounts
+                                     WHERE  hruid = {?}', $hrid);
+                $res2 = XDB::query('SELECT  COUNT(*)
+                                      FROM  profiles
+                                     WHERE  hrpid = {?}', $hrid);
+                if (is_null($hrid) || $res1->fetchOneCell() > 0 || $res2->fetchOneCell() > 0) {
+                    $report[] = $ax_id . ' non ajouté';
+                }
+                $fullName = $firstname . ' ' . $lastname;
+                $directoryName = $lastname . ' ' . $firstname;
+                ++$xorgId;
+
+                XDB::execute('REPLACE INTO  profiles (hrpid, xorg_id, ax_id, sex)
+                                    VALUES  ({?}, {?}, {?}, {?})',
+                             $hrid, $xorgId, $ax_id, $sex);
+                $pid = XDB::insertId();
+                XDB::execute('REPLACE INTO  profile_name (pid, name, typeid)
+                                    VALUES  ({?}, {?}, {?})',
+                             $pid, $lastname, $nameTypes['name_ini']);
+                XDB::execute('REPLACE INTO  profile_name (pid, name, typeid)
+                                    VALUES  ({?}, {?}, {?})',
+                             $pid, $firstname, $nameTypes['firstname_ini']);
+                XDB::execute('REPLACE INTO  profile_display (pid, yourself, public_name, private_name,
+                                                             directory_name, short_name, sort_name, promo)
+                                    VALUES  ({?}, {?}, {?}, {?}, {?}, {?}, {?}, {?})',
+                             $pid, $firstname, $fullName, $fullName, $directoryName, $fullName, $directoryName, $promo);
+                XDB::execute('REPLACE INTO  profile_education (pid, eduid, degreeid, entry_year, grad_year, flags)
+                                    VALUES  ({?}, {?}, {?}, {?}, {?}, {?})',
+                             $pid, $eduSchools[Profile::EDU_X], $degreeid, $entry_year, $grad_year, 'primary');
+                XDB::execute('REPLACE INTO  accounts (hruid, type, is_admin, state, full_name, directory_name, display_name, sex)
+                                    VALUES  ({?}, {?}, {?}, {?}, {?}, {?}, {?})',
+                             $hrid, $type, 0, 'active', $fullName, $directoryName, $lastname, $sex);
+                $uid = XDB::insertId();
+                XDB::execute('REPLACE INTO  account_profiles (uid, pid, perms)
+                                    VALUES  ({?}, {?}, {?})',
+                             $uid, $pid, 'owner');
             }
+            $report[] = 'Promo 1920 ajoutée.';
+            $next = 'view';
+        } elseif ($action == 'view') {
+            XDB::execute('CREATE OR REPLACE ALGORITHM=MERGE VIEW  fusionax_xorg_anciens AS
+                                                          SELECT  p.pid, p.ax_id, pd.promo, pd.private_name, pd.public_name,
+                                                                  pd.sort_name, pd.short_name, pd.directory_name
+                                                            FROM  profiles        AS p
+                                                      INNER JOIN  profile_display AS pd USING(pid)');
+            $next = 'clean';
         } elseif ($action == 'clean') {
             // nettoyage du fichier temporaire
-            chdir($olddir);
-            exec("rm -Rf $tmpdir", $report);
-            $report[] = "Fin de l\'import";
-            // met à jour la date de dernier import
-            //$globals->change_dynamic_config(array('LastUpdate' => time()), 'FusionAx');
+            exec('rm -Rf ' . $spoolpath);
+            $report[] = 'Import finit.';
         }
         foreach($report as $t) {
             // affiche les lignes de report
-            echo "$('#fusionax_import').append('" . $t . "<br/>');\n";
+            echo "$('#fusionax').append('" . $t . "<br/>');\n";
         }
         if (isset($next)) {
-            $tmpdir = getcwd();
-            chdir($olddir);
             // lance le prochain script s'il y en a un
-            echo "$.getScript('fusionax/import/" . $next . "?tmpdir=" . urlencode($tmpdir) . "');";
+            echo "$.getScript('fusionax/import/" . $next . "');";
         }
         // exit pour ne pas afficher la page template par défaut
         exit;
     }
 
-    /** Import de l'annuaire de l'AX depuis l'export situé dans le home de jacou */
     function handler_view(&$page, $action = '')
     {
-        $globals = Platal::globals();
-
         $page->changeTpl('fusionax/view.tpl');
         if ($action == 'create') {
             XDB::execute('DROP VIEW IF EXISTS fusionax_deceased');
             XDB::execute('CREATE VIEW  fusionax_deceased AS
-                               SELECT  u.user_id, a.id_ancien, u.nom, u.prenom, u.promo, u.deces AS deces_xorg, a.Date_deces AS deces_ax
-                                 FROM  auth_user_md5    AS u
-                           INNER JOIN  fusionax_anciens AS a ON (a.id_ancien = u.matricule_ax)
-                                WHERE  u.deces != a.Date_deces');
+                               SELECT  p.pid, a.ax_id, pd.private_name, pd.promo, p.deathdate AS deces_xorg, a.Date_deces AS deces_ax
+                                 FROM  profiles         AS p
+                           INNER JOIN  profile_display  AS pd ON (p.pid = pd.pid)
+                           INNER JOIN  fusionax_anciens AS a ON (a.ax_id = p.ax_id)
+                                WHERE  p.deathdate != a.Date_deces');
             XDB::execute('DROP VIEW IF EXISTS fusionax_promo');
             XDB::execute('CREATE VIEW  fusionax_promo AS
-                               SELECT  u.user_id, u.matricule_ax, CONCAT(u.nom, " ", u.prenom) AS display_name, u.promo AS promo_etude_xorg,
-                                       f.promotion_etude AS promo_etude_ax, u.promo_sortie AS promo_sortie_xorg
-                                 FROM  auth_user_md5    AS u
-                           INNER JOIN  fusionax_anciens AS f ON (u.matricule_ax = f.id_ancien)
-                                WHERE  u.promo != f.promotion_etude AND !(f.promotion_etude = u.promo + 1 AND u.promo_sortie = u.promo + 4)');
+                               SELECT  p.pid, p.ax_id, pd.private_name, pd.promo, pe.entry_year AS promo_etude_xorg,
+                                       f.promotion_etude AS promo_etude_ax, pe.grad_year AS promo_sortie_xorg
+                                 FROM  profiles          AS p
+                           INNER JOIN  profile_display   AS pd ON (p.pid = pd.pid)
+                           INNER JOIN  profile_education AS pe ON (p.pid = pe.pid)
+                           INNER JOIN  fusionax_anciens  AS f  ON (p.ax_id = f.ax_id)
+                                WHERE  pd.promo != CONCAT(\'X\', f.promotion_etude)
+                                       AND !(f.promotion_etude = pe.entry_year + 1 AND pe.grad_year = pe.entry_year + 4)');
+            $page->trigSuccess('Les VIEW ont bien été créées.');
         }
     }
 
     /* Mets à NULL le matricule_ax de ces camarades pour marquer le fait qu'ils ne figurent pas dans l'annuaire de l'AX */
-    private static function clear_wrong_in_xorg($user_id)
+    private static function clear_wrong_in_xorg($pid)
     {
-        $res = XDB::execute("UPDATE  fusionax_xorg_anciens
-                                SET  matricule_ax = NULL
-                              WHERE  user_id = {?}", $user_id);
+        $res = XDB::execute('UPDATE  fusionax_xorg_anciens
+                                SET  ax_id = NULL
+                              WHERE  pid = {?}', $pid);
         if (!$res) {
             return 0;
         }
@@ -200,12 +256,12 @@ class FusionAxModule extends PLModule
      * (mises à part les promo 1921 et 1923 qui ne figurent pas dans les données de l'AX)*/
     private static function find_wrong_in_xorg($limit = 10)
     {
-        return XDB::iterator("SELECT  u.promo, u.user_id, u.display_name
+        return XDB::iterator('SELECT  u.promo, u.pid, u.private_name
                                 FROM  fusionax_xorg_anciens AS u
                                WHERE  NOT EXISTS (SELECT  *
                                                     FROM  fusionax_anciens AS f
-                                                   WHERE  f.id_ancien = u.matricule_ax)
-                                      AND u.matricule_ax IS NOT NULL AND promo != 1921 AND promo != 1923");
+                                                   WHERE  f.ax_id = u.ax_id)
+                                      AND u.ax_id IS NOT NULL AND promo != \'X1921\' AND promo != \'X1923\'');
     }
 
     /** Lier les identifiants d'un ancien dans les deux annuaires
@@ -213,17 +269,17 @@ class FusionAxModule extends PLModule
      * @param matricule_ax identifiant dans l'annuaire de l'AX
      * @return 0 si la liaison a échoué, 1 sinon
      */
-    private static function link_by_ids($user_id, $matricule_ax)
+    private static function link_by_ids($pid, $ax_id)
     {
-        $res = XDB::execute("UPDATE  fusionax_import       AS i
+        $res = XDB::execute('UPDATE  fusionax_import       AS i
                          INNER JOIN  fusionax_xorg_anciens AS u
-                                SET  u.matricule_ax = i.id_ancien,
-                                     i.user_id = u.user_id,
+                                SET  u.ax_id = i.ax_id,
+                                     i.pid = u.pid,
                                      i.date_match_id = NOW()
-                              WHERE  i.id_ancien = {?} AND u.user_id = {?}
-                                     AND (u.matricule_ax != {?} OR u.matricule_ax IS NULL
-                                          OR i.user_id != {?} OR i.user_id IS NULL)",
-                            $matricule_ax, $user_id, $matricule_ax, $user_id);
+                              WHERE  i.ax_id = {?} AND u.pid = {?}
+                                     AND (u.ax_id != {?} OR u.ax_id IS NULL
+                                          OR i.pid != {?} OR i.pid IS NULL)',
+                            $ax_id, $pid, $ax_id, $pid);
         if (!$res) {
             return 0;
         }
@@ -234,68 +290,65 @@ class FusionAxModule extends PLModule
      * @param limit nombre d'anciens à trouver au max
      * @param sure si true, ne trouve que des anciens qui sont quasi sûrs
      * @return un XOrgDBIterator sur les entrées avec display_name, promo,
-     * user_id, id_ancien et display_name_ax
+     *   pid, ax_id et display_name_ax
      */
     private static function find_easy_to_link($limit = 10, $sure = false)
     {
         $easy_to_link = XDB::iterator("
-        SELECT  u.display_name, u.promo, u.user_id, ax.id_ancien,
-                CONCAT(ax.prenom, ' ', ax.nom_complet, ' (X ', ax.promotion_etude, ')') AS display_name_ax,
+        SELECT  u.private_name, u.promo, u.pid, ax.ax_id,
+                CONCAT(ax.prenom, ' ', ax.nom_complet, ' (X', ax.promotion_etude, ')') AS display_name_ax,
                 COUNT(*) AS nbMatches
           FROM  fusionax_anciens      AS ax
-    INNER JOIN  fusionax_import       AS i ON (i.id_ancien = ax.id_ancien AND i.user_id IS NULL)
-     LEFT JOIN  fusionax_xorg_anciens AS u ON (u.matricule_ax IS NULL
-                                               AND ax.Nom_patronymique = u.nom
-                                               AND ax.prenom = u.prenom
-                                               AND u.promo = ax.promotion_etude)
-      GROUP BY  u.user_id
-        HAVING  u.user_id IS NOT NULL AND nbMatches = 1 " . ($limit ? ('LIMIT ' . $limit) : ''));
+    INNER JOIN  fusionax_import       AS i ON (i.ax_id = ax.ax_id AND i.pid IS NULL)
+     LEFT JOIN  fusionax_xorg_anciens AS u ON (u.ax_id IS NULL
+                                               AND u.promo = CONCAT('X', ax.promotion_etude)
+                                               AND (CONCAT(ax.prenom, ' ', ax.nom_complet) = u.private_name
+                                                    OR CONCAT(ax.prenom, ' ', ax.nom_complet) = u.public_name
+                                                    OR CONCAT(ax.prenom, ' ', ax.nom_complet) = u.short_name))
+      GROUP BY  u.pid
+        HAVING  u.pid IS NOT NULL AND nbMatches = 1" . ($limit ? (' LIMIT ' . $limit) : ''));
         if ($easy_to_link->total() > 0 || $sure) {
             return $easy_to_link;
         }
         return XDB::iterator("
-        SELECT  u.display_name, u.promo, u.user_id, ax.id_ancien,
-                CONCAT(ax.prenom, ' ', ax.nom_complet, ' (X ', ax.promotion_etude, ')') AS display_name_ax,
+        SELECT  u.private_name, u.promo, u.pid, ax.ax_id,
+                CONCAT(ax.prenom, ' ', ax.nom_complet, ' (X', ax.promotion_etude, ')') AS display_name_ax,
                 COUNT(*) AS nbMatches
           FROM  fusionax_anciens      AS ax
-    INNER JOIN  fusionax_import       AS i ON (i.id_ancien = ax.id_ancien AND i.user_id IS NULL)
-     LEFT JOIN  fusionax_xorg_anciens AS u ON (u.matricule_ax IS NULL
-                                               AND (ax.Nom_patronymique = u.nom
-                                                    OR ax.Nom_patronymique LIKE CONCAT(u.nom, ' %')
-                                                    OR ax.Nom_patronymique LIKE CONCAT(u.nom, '-%')
-                                                    OR ax.Nom_usuel = u.nom
-                                                    OR u.nom LIKE CONCAT('% ', ax.Nom_patronymique))
-                                               AND u.promo < ax.promotion_etude + 2
-                                               AND u.promo > ax.promotion_etude - 2)
-      GROUP BY  u.user_id
-        HAVING  u.user_id IS NOT NULL AND nbMatches = 1 " . ($limit ? ('LIMIT ' . $limit) : ''));
+    INNER JOIN  fusionax_import       AS i ON (i.ax_id = ax.ax_id AND i.pid IS NULL)
+     LEFT JOIN  fusionax_xorg_anciens AS u ON (u.ax_id IS NULL
+                                               AND (CONCAT(ax.prenom, ' ', ax.nom_complet) = u.private_name
+                                                    OR CONCAT(ax.prenom, ' ', ax.nom_complet) = u.public_name
+                                                    OR CONCAT(ax.prenom, ' ', ax.nom_complet) = u.short_name)
+                                               AND u.promo < CONCAT('X', ax.promotion_etude + 2)
+                                               AND u.promo > CONCAT('X', ax.promotion_etude - 2))
+      GROUP BY  u.pid
+        HAVING  u.pid IS NOT NULL AND nbMatches = 1" . ($limit ? (' LIMIT ' . $limit) : ''));
     }
 
     /** Module de mise en correspondance les ids */
-    function handler_ids(&$page, $part = 'main', $user_id = null, $matricule_ax = null)
+    function handler_ids(&$page, $part = 'main', $pid = null, $ax_id = null)
     {
-        $globals = Platal::globals();
         $nbToLink = 100;
-
         $page->assign('xorg_title', 'Polytechnique.org - Fusion - Mise en correspondance simple');
+
         if ($part == 'missingInAX') {
             // locate all persons from this database that are not in AX's
             $page->changeTpl('fusionax/idsMissingInAx.tpl');
-            $missingInAX = XDB::iterator("SELECT  promo, user_id, display_name
+            $missingInAX = XDB::iterator('SELECT  promo, pid, private_name
                                             FROM  fusionax_xorg_anciens
-                                           WHERE  matricule_ax IS NULL");
+                                           WHERE  ax_id IS NULL');
             $page->assign('missingInAX', $missingInAX);
             return;
         }
         if ($part == 'missingInXorg') {
             // locate all persons from AX's database that are not here
             $page->changeTpl('fusionax/idsMissingInXorg.tpl');
-            $missingInXorg = XDB::iterator("SELECT  a.promotion_etude AS promo,
-                                                    CONCAT(a.prenom, ' ', a.Nom_usuel) AS display_name,
-                                                    a.id_ancien
+            $missingInXorg = XDB::iterator("SELECT  CONCAT(a.prenom, ' ', a.Nom_usuel) AS private_name,
+                                                    a.promotion_etude AS promo, a.ax_id
                                               FROM  fusionax_import
-                                        INNER JOIN  fusionax_anciens AS a USING (id_ancien)
-                                             WHERE  fusionax_import.user_id IS NULL");
+                                        INNER JOIN  fusionax_anciens AS a USING (ax_id)
+                                             WHERE  fusionax_import.pid IS NULL");
             $page->assign('missingInXorg', $missingInXorg);
             return;
         }
@@ -309,43 +362,43 @@ class FusionAxModule extends PLModule
         if ($part == 'cleanwronginxorg') {
             $linksToDo = FusionAxModule::find_wrong_in_xorg($nbToLink);
             while ($l = $linksToDo->next()) {
-                FusionAxModule::clear_wrong_in_xorg($l['user_id']);
+                FusionAxModule::clear_wrong_in_xorg($l['pid']);
             }
             pl_redirect('fusionax/ids/wrongInXorg');
         }
         if ($part == 'lier') {
             if (Post::has('user_id') && Post::has('matricule_ax')) {
-                FusionAxModule::link_by_ids(Post::i('user_id'), Post::v('matricule_ax'));
+                FusionAxModule::link_by_ids(Post::i('pid'), Post::v('ax_id'));
             }
         }
         if ($part == 'link') {
-            FusionAxModule::link_by_ids($user_id, $matricule_ax);
+            FusionAxModule::link_by_ids($pid, $ax_id);
             exit;
         }
         if ($part == 'linknext') {
             $linksToDo = FusionAxModule::find_easy_to_link($nbToLink);
             while ($l = $linksToDo->next()) {
-                FusionAxModule::link_by_ids($l['user_id'], $l['id_ancien']);
+                FusionAxModule::link_by_ids($l['pid'], $l['ax_id']);
             }
             pl_redirect('fusionax/ids#autolink');
         }
         if ($part == 'linkall') {
             $linksToDo = FusionAxModule::find_easy_to_link(0);
             while ($l = $linksToDo->next()) {
-                FusionAxModule::link_by_ids($l['user_id'], $l['id_ancien']);
+                FusionAxModule::link_by_ids($l['pid'], $l['ax_id']);
             }
         }
         {
             $page->changeTpl('fusionax/ids.tpl');
             $missingInAX = XDB::query('SELECT  COUNT(*)
-                                         FROM  fusionax_xorg_anciens AS u
-                                        WHERE  u.matricule_ax IS NULL');
+                                         FROM  fusionax_xorg_anciens
+                                        WHERE  ax_id IS NULL');
             if ($missingInAX) {
                 $page->assign('nbMissingInAX', $missingInAX->fetchOneCell());
             }
             $missingInXorg = XDB::query('SELECT  COUNT(*)
-                                           FROM  fusionax_import AS i
-                                          WHERE  i.user_id IS NULL');
+                                           FROM  fusionax_import
+                                          WHERE  pid IS NULL');
             if ($missingInXorg) {
                 $page->assign('nbMissingInXorg', $missingInXorg->fetchOneCell());
             }
@@ -374,36 +427,32 @@ class FusionAxModule extends PLModule
                            WHERE  deces_ax = "0000-00-00"');
         }
         if ($action == 'update') {
-            if (Post::has('user_id') && Post::has('date')) {
+            if (Post::has('pid') && Post::has('date')) {
                 XDB::execute('UPDATE  fusionax_deceased
                                  SET  deces_ax = {?}, deces_xorg = {?}
-                               WHERE  user_id = {?}',
-                             Post::v('date'), Post::v('date'), Post::i('user_id'));
+                               WHERE  pid = {?}',
+                             Post::v('date'), Post::v('date'), Post::i('pid'));
             }
         }
         $page->changeTpl('fusionax/deceased.tpl');
         // deceased
         $deceasedErrorsSql = XDB::query('SELECT COUNT(*) FROM fusionax_deceased');
         $page->assign('deceasedErrors', $deceasedErrorsSql->fetchOneCell());
-        $res = XDB::iterator('SELECT  d.user_id, d.id_ancien, d.nom, d.prenom, d.promo, d.deces_ax,
-                                      CONCAT(d.prenom, " ", d.nom) AS display_name
-                                FROM  fusionax_deceased AS d
-                               WHERE  d.deces_xorg = "0000-00-00"
+        $res = XDB::iterator('SELECT  pid, ax_id, promo, private_name, deces_ax
+                                FROM  fusionax_deceased
+                               WHERE  deces_xorg = "0000-00-00"
                                LIMIT  10');
         $page->assign('nbDeceasedMissingInXorg', $res->total());
         $page->assign('deceasedMissingInXorg', $res);
-        $res = XDB::iterator('SELECT  d.user_id, d.id_ancien, d.nom, d.prenom, d.promo, d.deces_xorg,
-                                      CONCAT(d.prenom, " ", d.nom) AS display_name
-                                FROM  fusionax_deceased AS d
-                               WHERE  d.deces_ax = "0000-00-00"
+        $res = XDB::iterator('SELECT  pid, ax_id, promo, private_name, deces_xorg
+                                FROM  fusionax_deceased
+                               WHERE  deces_ax = "0000-00-00"
                                LIMIT  10');
         $page->assign('nbDeceasedMissingInAX', $res->total());
         $page->assign('deceasedMissingInAX', $res);
-        $res = XDB::iterator('SELECT  d.user_id, d.id_ancien, d.nom, d.prenom, d.promo,
-                                      d.deces_ax, d.deces_xorg,
-                                      CONCAT(d.prenom, " ", d.nom, " ", d.user_id) AS display_name
-                                FROM  fusionax_deceased AS d
-                               WHERE  d.deces_xorg != "0000-00-00" AND d.deces_ax != "0000-00-00"');
+        $res = XDB::iterator('SELECT  pid, ax_id, promo, private_name, deces_xorg, deces_ax
+                                FROM  fusionax_deceased
+                               WHERE  deces_xorg != "0000-00-00" AND deces_ax != "0000-00-00"');
         $page->assign('nbDeceasedDifferent', $res->total());
         $page->assign('deceasedDifferent', $res);
     }
@@ -411,13 +460,13 @@ class FusionAxModule extends PLModule
     function handler_promo(&$page, $action = '')
     {
         $page->changeTpl('fusionax/promo.tpl');
-        $res = XDB::iterator('SELECT  user_id, display_name, promo_etude_xorg, promo_sortie_xorg, promo_etude_ax
+        $res = XDB::iterator('SELECT  pid, private_name, promo_etude_xorg, promo_sortie_xorg, promo_etude_ax, promo
                                 FROM  fusionax_promo
                                WHERE  !(promo_etude_ax + 1 = promo_etude_xorg AND promo_etude_xorg + 3 = promo_sortie_xorg)');
         $nbMissmatchingPromos = $res->total();
         $page->assign('nbMissmatchingPromos1', $res->total());
         $page->assign('missmatchingPromos1', $res);
-        $res = XDB::iterator('SELECT  user_id, display_name, promo_etude_xorg, promo_sortie_xorg, promo_etude_ax
+        $res = XDB::iterator('SELECT  pid, private_name, promo_etude_xorg, promo_sortie_xorg, promo_etude_ax, promo
                                 FROM  fusionax_promo
                                WHERE  promo_etude_ax + 1 = promo_etude_xorg AND promo_etude_xorg + 3 = promo_sortie_xorg');
         $nbMissmatchingPromos += $res->total();
index 33ddbdc..a09de5b 100644 (file)
@@ -7,14 +7,14 @@ CREATE TABLE IF NOT EXISTS `fusionax_activites` (
   `id_ancien` VARCHAR(8) NOT NULL COMMENT 'Id unique de l''ancien',
   `hash_activite` BINARY(5) NOT NULL COMMENT 'Hash de cette ligne pour la lier à l''adresse',
   `Code_etab` BIGINT(10) NOT NULL COMMENT 'Code de l''établissement',
-  `Raison_sociale` VARCHAR(255) collate utf8_general_ci NOT NULL COMMENT 'Raison sociale de l''établissement',
-  `Libelle_fonctio` VARCHAR(255) collate utf8_general_ci NOT NULL COMMENT 'Libéllé de la fonction',
+  `Raison_sociale` VARCHAR(255) NOT NULL COMMENT 'Raison sociale de l''établissement',
+  `Libelle_fonctio` VARCHAR(255) NOT NULL COMMENT 'Libéllé de la fonction',
   `Annuaire` BOOLEAN NOT NULL COMMENT 'publiable dans l''annuaire papier',
   `Date_maj` DATE NOT NULL COMMENT 'Date de mise à jour de ces informations',
   PRIMARY KEY( `id_ancien` , `hash_activite` )
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
 
-LOAD DATA LOCAL INFILE 'Activites.txt' INTO TABLE `fusionax_activites` FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\r\n'
+LOAD DATA LOCAL INFILE '{?}Activites.txt' INTO TABLE `fusionax_activites` FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\r\n'
 (AC, id_ancien, Code_etab, Raison_sociale, Libelle_fonctio, Annuaire,
 @Ligne1, @Ligne2, @Ligne3, @code_postal, @ville, @zip_cedex, @etat_distr, @pays, @tel, @fax, @StringDate_maj)
 SET
index 172e071..f7d31a8 100644 (file)
@@ -7,28 +7,28 @@ CREATE TABLE IF NOT EXISTS fusionax_adresses (
   id_ancien VARCHAR(8) NOT NULL COMMENT 'Id unique de l''ancien',
   Type_adr ENUM('E', 'P') character set binary NOT NULL DEFAULT 'P' COMMENT 'Type d''adresse : E pour Entreprise, P pour Personnelle',
   hash_adresse BINARY(5) NOT NULL COMMENT 'Hash pour différencier les diverses adresses',
-  Ligne1 VARCHAR(90) character set utf8 NOT NULL,
-  Ligne2 VARCHAR(90) character set utf8 NOT NULL,
-  Ligne3 VARCHAR(90) character set utf8 NOT NULL,
-  code_postal VARCHAR(20) character set utf8 NOT NULL,
-  ville VARCHAR(80) character set utf8 NOT NULL,
-  zip_cedex VARCHAR(20) character set utf8 NOT NULL,
-  etat_distr VARCHAR(20) character set utf8 NOT NULL,
-  pays VARCHAR(50) character set utf8 NOT NULL,
+  Ligne1 VARCHAR(90) NOT NULL,
+  Ligne2 VARCHAR(90) NOT NULL,
+  Ligne3 VARCHAR(90) NOT NULL,
+  code_postal VARCHAR(20) NOT NULL,
+  ville VARCHAR(80) NOT NULL,
+  zip_cedex VARCHAR(20) NOT NULL,
+  etat_distr VARCHAR(20) NOT NULL,
+  pays VARCHAR(50) NOT NULL,
   tel VARCHAR(30) NOT NULL,
   fax VARCHAR(30) NOT NULL,
   Date_maj DATE NOT NULL,
   PRIMARY KEY  (id_ancien, hash_adresse)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
+) ENGINE=InnoDB, CHARSET=utf8;
 
-LOAD DATA LOCAL INFILE 'Adresses.txt' INTO TABLE `fusionax_adresses` FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\r\n'
+LOAD DATA LOCAL INFILE '{?}Adresses.txt' INTO TABLE `fusionax_adresses` FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\r\n'
 (provenance, id_ancien, @Type_adr, Ligne1, Ligne2, Ligne3, code_postal, ville, zip_cedex, etat_distr, pays, tel, fax, @StringDate_maj)
 SET
 `Type_adr` = IF(@Type_adr = 'E', 'E', IF(@Type_adr = '', '', 'P')),
 `hash_adresse` = SUBSTRING( MD5( @Type_adr ), 1, 5),
 `Date_maj` = CONCAT(SUBSTRING(@StringDate_maj,7),'-',SUBSTRING(@StringDate_maj,4,2),'-',SUBSTRING(@StringDate_maj,1,2));
 
-LOAD DATA LOCAL INFILE 'Anciens.txt' INTO TABLE `fusionax_adresses` FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\r\n'
+LOAD DATA LOCAL INFILE '{?}Anciens.txt' INTO TABLE `fusionax_adresses` FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\r\n'
 (provenance, id_ancien, @Login, @Password, @promotion_etude, @Groupe_promo, @Nom_patronymique, @partic_patro, @prenom, @Nom_usuel, @partic_nom,
     @Nom_complet, @Civilite, @Code_nationalite, @Type_membre, @corps_sortie, @StringDate_deces, @grade, @Mel_usage, @Mel_publiable,
     @tel_mobile, @annee_dernCot, @Representant, @Type_adr, Ligne1, Ligne2, Ligne3, code_postal, ville,
@@ -38,7 +38,7 @@ SET
 `hash_adresse` = SUBSTRING( MD5( @Type_adr ), 1, 5),
 `Date_maj` = CONCAT(SUBSTRING(@StringDate_maj,7),'-',SUBSTRING(@StringDate_maj,4,2),'-',SUBSTRING(@StringDate_maj,1,2));
 
-LOAD DATA LOCAL INFILE 'Activites.txt' INTO TABLE `fusionax_adresses` FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\r\n'
+LOAD DATA LOCAL INFILE '{?}Activites.txt' INTO TABLE `fusionax_adresses` FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\r\n'
 (provenance, id_ancien, @Code_etab, @Raison_sociale, @Libelle_fonctio, @Annuaire,
 Ligne1, Ligne2, Ligne3, code_postal, ville, zip_cedex, etat_distr, pays, tel, fax, @StringDate_maj)
 SET
index 7964f43..54eda32 100644 (file)
@@ -4,21 +4,21 @@ DROP TABLE IF EXISTS fusionax_anciens;
 
 CREATE TABLE IF NOT EXISTS fusionax_anciens (
   AN CHAR(2) NOT NULL COMMENT 'Vaut toujours AN pour cette table',
-  id_ancien VARCHAR(8) NOT NULL COMMENT 'Id unique de l''ancien',
+  ax_id VARCHAR(8) NOT NULL COMMENT 'Id unique de l''ancien',
   Login VARCHAR(15) NOT NULL COMMENT 'Login sur le site de l''AX',
   Password INT(11) NOT NULL COMMENT 'Mot de passe sur le site AX',
   promotion_etude SMALLINT(4) NOT NULL COMMENT 'Promotion avec laquelle il/elle a fait ses études',
   Groupe_promo ENUM('', 'A', 'B', 'C', 'N', 'S') character set binary NOT NULL COMMENT 'Groupe de promotion (code compris seulement par AX)',
-  Nom_patronymique VARCHAR(255) character set utf8 NOT NULL COMMENT 'Nom patronymique (nom de jeune fille) sans la particule',
-  partic_patro VARCHAR(5) character set utf8 NOT NULL COMMENT 'Particule du nom patronymique',
-  prenom VARCHAR(30) character set utf8 NOT NULL COMMENT 'Prénom',
-  Nom_usuel VARCHAR(255) character set utf8 NOT NULL COMMENT 'Nom usuel (nom marital par exemple) sans la particule',
-  partic_nom VARCHAR(5) character set utf8 NOT NULL COMMENT 'Particule du nom usuel',
-  Nom_complet VARCHAR(255) character set utf8 NOT NULL COMMENT 'Nom patronymique complet (avec la particule)',
-  Civilite ENUM('', '.', 'M', 'MME', 'MLLE') character set utf8 NOT NULL COMMENT 'Civilité',
+  Nom_patronymique VARCHAR(255) NOT NULL COMMENT 'Nom patronymique (nom de jeune fille) sans la particule',
+  partic_patro VARCHAR(5) NOT NULL COMMENT 'Particule du nom patronymique',
+  prenom VARCHAR(30) NOT NULL COMMENT 'Prénom',
+  Nom_usuel VARCHAR(255) NOT NULL COMMENT 'Nom usuel (nom marital par exemple) sans la particule',
+  partic_nom VARCHAR(5) NOT NULL COMMENT 'Particule du nom usuel',
+  Nom_complet VARCHAR(255) NOT NULL COMMENT 'Nom patronymique complet (avec la particule)',
+  Civilite ENUM('', '.', 'M', 'MME', 'MLLE') NOT NULL COMMENT 'Civilité',
   Code_nationalite CHAR(4) NOT NULL COMMENT 'Nationalité (code)',
   Type_membre ENUM('', '*', 'F', 'FB', 'P', 'PB', 'T', 'TB', 'TA') character set binary NOT NULL COMMENT 'Type de membre (code compris seulement par AX)',
-  corps_sortie VARCHAR(50) character set utf8 NOT NULL COMMENT 'Corps de sortie (ou D si aucun)',
+  corps_sortie VARCHAR(50) NOT NULL COMMENT 'Corps de sortie (ou D si aucun)',
   Date_deces DATE COMMENT 'Date de décès',
   grade VARCHAR(50) NOT NULL COMMENT 'Grade actuel dans son corps',
   Mel_usage VARCHAR(255) NOT NULL COMMENT 'Adresse e-mail d''usage',
@@ -28,11 +28,11 @@ CREATE TABLE IF NOT EXISTS fusionax_anciens (
   Representant ENUM('', 'K', 'DE') character set binary NOT NULL COMMENT 'Représentant de promotion',
   hash_adr_defaut BINARY(5) NOT NULL COMMENT 'Hash de l''adresse par défaut',
   Date_maj DATE NOT NULL,
-  PRIMARY KEY  (id_ancien)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
+  PRIMARY KEY  (ax_id)
+) ENGINE=InnoDB, CHARSET=utf8;
 
-LOAD DATA LOCAL INFILE 'Anciens.txt' INTO TABLE `fusionax_anciens` FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\r\n'
-(`AN`, `id_ancien`, `Login`, `Password`, `promotion_etude`, `Groupe_promo`, `Nom_patronymique`, `partic_patro`, `prenom`, Nom_usuel, partic_nom,
+LOAD DATA LOCAL INFILE '{?}Anciens.txt' INTO TABLE `fusionax_anciens` FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\r\n'
+(`AN`, `ax_id`, `Login`, `Password`, `promotion_etude`, `Groupe_promo`, `Nom_patronymique`, `partic_patro`, `prenom`, Nom_usuel, partic_nom,
     Nom_complet, Civilite, Code_nationalite, Type_membre, corps_sortie, @StringDate_deces, grade, Mel_usage, Mel_publiable,
     tel_mobile, annee_dernCot, Representant, @Type_adr_defaut, @AdrC_Ligne1, @AdrC_Ligne2, @AdrC_Ligne3, @AdrC_code_postal, @AdrC_ville,
     @AdrC_zip_cedex, @AdrC_etat_distr, @AdrC_pays, @tel, @fax, @StringDate_maj)
@@ -41,18 +41,45 @@ SET
     `Date_maj` = CONCAT(SUBSTRING(@StringDate_maj,7),'-',SUBSTRING(@StringDate_maj,4,2),'-',SUBSTRING(@StringDate_maj,1,2)),
     `Date_deces` = CONCAT(SUBSTRING(@StringDate_deces,7),'-',SUBSTRING(@StringDate_deces,4,2),'-',SUBSTRING(@StringDate_deces,1,2));
 
-ALTER TABLE fusionax_anciens ADD INDEX (id_ancien);
+ALTER TABLE fusionax_anciens ADD INDEX (ax_id);
 
 -- Correspondances entre fiches X.org et fiches AX
 DROP TABLE IF EXISTS `fusionax_import`;
 
 CREATE TABLE IF NOT EXISTS `fusionax_import` (
-  `id_ancien` VARCHAR(8) NOT NULL COMMENT 'identifiant AX de l''ancien',
-  `user_id` INT(11) DEFAULT NULL COMMENT 'identifiant x.org de l''ancien si on l''a trouvé',
+  `ax_id` VARCHAR(8) NOT NULL COMMENT 'identifiant AX de l''ancien',
+  `pid` INT(11) DEFAULT NULL COMMENT 'identifiant du profil x.org de l''ancien si on l''a trouvé',
   `date_match_id` TIMESTAMP NULL DEFAULT NULL COMMENT 'date de mise en correspondance des identifiants',
-  PRIMARY KEY  (`id_ancien`),
-  KEY `user_id` (`user_id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
+  PRIMARY KEY  (`ax_id`),
+  KEY `pid` (`pid`)
+) ENGINE=InnoDB, CHARSET=utf8;
 
-INSERT INTO `fusionax_import` ( SELECT `id_ancien`, NULL, NULL FROM `fusionax_anciens` );
-REPLACE INTO `fusionax_import` ( SELECT `matricule_ax`, `user_id`, NOW() FROM `auth_user_md5` );
+INSERT INTO `fusionax_import` ( SELECT `ax_id`, NULL, NULL FROM `fusionax_anciens` );
+REPLACE INTO `fusionax_import` ( SELECT `ax_id`, `pid`, NOW() FROM `profiles` );
+
+CREATE TEMPORARY TABLE IF NOT EXISTS tmp_update_fusionax_anciens (
+  good CHAR(4) DEFAULT NULL,
+  bad CHAR(4) DEFAULT NULL,
+  PRIMARY KEY(bad),
+  UNIQUE KEY(good)
+) CHARSET=utf8;
+
+INSERT IGNORE INTO  tmp_update_fusionax_anciens (bad, good)
+            VALUES  ('TC', 'CAM'),
+                    ('SH', 'CN'),
+                    ('R', 'RO'),
+                    ('TW', 'RC'),
+                    ('TG', 'RT'),
+                    ('U', 'ROU'),
+                    ('KP', 'ROK'),
+                    ('CRO', 'HR'),
+                    ('UKR', 'UA'),
+                    ('AM', 'ARM'),
+                    ('CS', 'CZ'),
+                    ('SU', 'RUS'),
+                    ('LET', 'LV'),
+                    ('MDA', 'MD');
+
+    UPDATE  fusionax_anciens            AS f
+INNER JOIN  tmp_update_fusionax_anciens AS t ON (f.Code_nationalite = t.bad)
+       SET  f.Code_nationalite = t.good;
index a14ccd1..63de3bb 100644 (file)
@@ -5,13 +5,13 @@ DROP TABLE IF EXISTS `fusionax_entreprises`;
 CREATE TABLE IF NOT EXISTS `fusionax_entreprises` (
   `EN` CHAR(2) NOT NULL COMMENT 'Vaut toujours EN pour cette table',
   `Code_etab` BIGINT(10) NOT NULL COMMENT 'Code de l''établissement',
-  `Raison_sociale` VARCHAR(255) collate utf8_general_ci NOT NULL COMMENT 'Raison sociale de l''établissement',
-  `Sigle` VARCHAR(50) collate utf8_general_ci NOT NULL COMMENT 'Sigle de l''établissement',
+  `Raison_sociale` VARCHAR(255) NOT NULL COMMENT 'Raison sociale de l''établissement',
+  `Sigle` VARCHAR(50) NOT NULL COMMENT 'Sigle de l''établissement',
   `Date_maj` DATE NOT NULL COMMENT 'Date de mise à jour de ces informations',
   PRIMARY KEY(`Code_etab`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
+) ENGINE=InnoDB, CHARSET=utf8;
 
-LOAD DATA LOCAL INFILE 'Entreprises.txt' INTO TABLE `fusionax_entreprises` FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\r\n'
+LOAD DATA LOCAL INFILE '{?}Entreprises.txt' INTO TABLE `fusionax_entreprises` FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\r\n'
 (EN, Code_etab, Raison_sociale, Sigle, @Inconnu, @StringDate_maj)
 SET
 `Date_maj` = CONCAT(SUBSTRING(@StringDate_maj,7),'-',SUBSTRING(@StringDate_maj,4,2),'-',SUBSTRING(@StringDate_maj,1,2));
index c2b09f6..3906862 100644 (file)
@@ -5,16 +5,16 @@ DROP TABLE IF EXISTS `fusionax_formations`;
 CREATE TABLE IF NOT EXISTS `fusionax_formations` (
   FO CHAR(2) NOT NULL COMMENT 'Vaut toujours FO pour cette table',
   id_ancien VARCHAR(8) NOT NULL COMMENT 'Id unique de l''ancien',
-  Intitule_diplome VARCHAR(60) collate utf8_general_ci NOT NULL COMMENT 'Intitulé du diplôme',
-  Intitule_formation VARCHAR(60) collate utf8_general_ci NOT NULL COMMENT 'Intitulé de la formation',
-  Descr_formation VARCHAR(60) collate utf8_general_ci NOT NULL COMMENT 'Description de la formation',
-  tmp_1 VARCHAR(60) collate utf8_general_ci NOT NULL,
-  tmp_2 VARCHAR(60) collate utf8_general_ci NOT NULL,
-  tmp_3 VARCHAR(60) collate utf8_general_ci NOT NULL,
-  tmp_4 VARCHAR(60) collate utf8_general_ci NOT NULL,
+  Intitule_diplome VARCHAR(60) NOT NULL COMMENT 'Intitulé du diplôme',
+  Intitule_formation VARCHAR(60) NOT NULL COMMENT 'Intitulé de la formation',
+  Descr_formation VARCHAR(60) NOT NULL COMMENT 'Description de la formation',
+  tmp_1 VARCHAR(60) NOT NULL,
+  tmp_2 VARCHAR(60) NOT NULL,
+  tmp_3 VARCHAR(60) NOT NULL,
+  tmp_4 VARCHAR(60) NOT NULL,
   PRIMARY KEY (id_ancien, Intitule_diplome, Intitule_formation)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
+) ENGINE=InnoDB, CHARSET=utf8;
 
-                              LOAD DATA LOCAL INFILE  'Formations.txt'
+                              LOAD DATA LOCAL INFILE  '{?}Formations.txt'
                                           INTO TABLE  fusionax_formations
 FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\r\n'  (FO, id_ancien, Intitule_diplome, Intitule_formation, Descr_formation, tmp_1, tmp_2, tmp_3, tmp_4);
index 14b72dc..c6eb6a7 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 use utf8;
-open(FILE, "<:encoding(UTF-8)", "Formations.txt") || die ("Erreur d'ouverture");
-open(OUT, ">:encoding(UTF-8)", "Formations_out.txt") || die ("Erreur d'ouverture");
+open(FILE, "<:encoding(UTF-8)", "../../spool/fusionax/Formations.txt") || die ("Erreur d'ouverture");
+open(OUT, ">:encoding(UTF-8)", "../../spool/fusionax/Formations_out.txt") || die ("Erreur d'ouverture");
 
 while (<FILE>)
 {
diff --git a/modules/fusionax/import-ax.sh b/modules/fusionax/import-ax.sh
deleted file mode 100755 (executable)
index 999c16f..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#! /bin/bash
-
-# import des données
-#scp -i ax_xorg_rsa xorg@polytechniciens.com:/home/axasso/ax-import/export_4D.txt.rar .
-#unrar e -inul export_4D.txt.rar
-cp /home/x2004jacob/export*utf8.TXT .
-
-# séparation en fichiers de tables
-cat export_total* | grep ^AD > Adresses.txt
-cat export_total* | grep ^AN > Anciens.txt
-cat export_total* | grep ^FO > Formations.txt
-cat export_total* | grep ^AC > Activites.txt
-cat export_total* | grep ^EN > Entreprises.txt
-
-exit 1
-
-# intégration dans notre bdd
-echo intégration dans notre bdd
-$MYSQL x4dat < Activites.sql
-$MYSQL x4dat < Adresses.sql
-$MYSQL x4dat < Anciens.sql
-$MYSQL x4dat < Entreprises.sql
-./formation.pl
-cat Formations_out.txt > Formations.txt
-rm -f Formations_out.txt
-$MYSQL x4dat < Formations.sql
-
-
-# nettoyage
-echo nettoyage
-#rm Adresses.txt Anciens.txt Formations.txt Activites.txt Entreprises.txt export_4D.txt.rar export-total*
-rm Adresses.txt Anciens.txt Formations.txt Activites.txt Entreprises.txt export-total*
index 8a0aa9d..9fad56d 100644 (file)
@@ -20,7 +20,7 @@
 {*                                                                        *}
 {**************************************************************************}
 
-<h2><a href="fusionax">Fusion des annuaires X.org - AX<a> / Décès</h2>
+<h2><a href="fusionax">Fusion des annuaires X.org - AX</a> / Décès</h2>
 
 {if $deceasedErrors}
 <p>Voici les {$deceasedErrors} différences entre les deux annuaires pour les renseignements de
@@ -46,9 +46,11 @@ décès.</p>
 
 <h3>Mettre en correspondance</h3>
 <form action="fusionax/deceased/update" method="post">
-  User ID X.org : <input type="text" name="user_id" value=""/><br/>
-  Date de décès : <input type="text" name="date" value""/><br/>
-  <input type="submit" value="Mettre à jour"/>
+<p>
+  PID X.org : <input type="text" name="pid" /><br />
+  Date de décès : <input type="text" name="date" /><br />
+  <input type="submit" value="Mettre à jour" />
+</p>
 </form>
 {/if}
 
index a2bb9fd..a26788c 100644 (file)
 
 <h2><a href="fusionax">Fusion des annuaires X.org - AX</a> / Identifiants</h2>
 
-<p>Le préalable à toute fusion de renseignements pour une personne entre ce
+<p>
+Le préalable à toute fusion de renseignements pour une personne entre ce
 que contient la base AX et ce que contient ce site est bien évidemment de
-trouver une correspondance entre les personnes renseignés dans ces annuaires.</p>
-
-{if $nbMissingInAX}
-<h3>Anciens manquants à l'AX</h3>
+trouver une correspondance entre les personnes renseignés dans ces annuaires.<br /><br />
 
-<p><a href="fusionax/ids/missingInAX">{$nbMissingInAX} ancien{if $nbMissingInAX > 1}s{/if}</a>.</p>
+{if t($nbMissingInAX)}
+<strong>Anciens manquants à l'AX&nbsp;:</strong>
+<a href="fusionax/ids/missingInAX">{$nbMissingInAX} ancien{if $nbMissingInAX > 1}s{/if}</a>.<br />
 {/if}
 
-{if $nbMissingInXorg > 0}
-<h3>Anciens manquants à x.org</h3>
-
-<p><a href="fusionax/ids/missingInXorg">{$nbMissingInXorg} ancien{if $nbMissingInXorg > 1}s{/if}</a>.</p>
+{if t($nbMissingInXorg)}
+<strong>Anciens manquants à x.org&nbsp;:</strong>
+<a href="fusionax/ids/missingInXorg">{$nbMissingInXorg} ancien{if $nbMissingInXorg > 1}s{/if}</a>.<br />
 {/if}
 
-{if $wrongInXorg > 0}
-<h3>Anciens ayant un matricule_ax sur Xorg ne correspondant à rien dans la base de l'AX</h3>
-
-<p><a href="fusionax/ids/wrongInXorg">{$wrongInXorg} ancien{if $wrongInXorg > 1}s{/if}</a>.</p>
+{if t($wrongInXorg)}
+<strong>Anciens ayant un ax_id sur Xorg ne correspondant à rien dans la base de l'AX&nbsp;:</strong>
+<a href="fusionax/ids/wrongInXorg">{$wrongInXorg} ancien{if $wrongInXorg > 1}s{/if}</a>.
 {/if}
+</p>
 
 <h3>Mettre en correspondance</h3>
 <form action="fusionax/ids/lier" method="post">
-       Matricule AX : <input type="text" name="matricule_ax" value""/><br/>
-       User ID X.org : <input type="text" name="user_id" value=""/><br/>
-       <input type="submit" value="Lier"/>
+  <p>
+    Matricule AX : <input type="text" name="ax_id" /><br/>
+    User ID X.org : <input type="text" name="pid" /><br/>
+    <input type="submit" value="Lier" />
+  </p>
 </form>
 
 <p></p>
-<div id="autolink" name="autolink">
+<div id="autolink">
 <h3>Mise en correspondance automatique</h3>
-{if $easyToLink}
+{if t($easyToLink)}
 <p>
   Ces anciens sont probablement les mêmes (à peu près mêmes nom, prénom, promo)<br />
   {$nbMatch} correspondances trouvées.
index 3b543fb..83aa8fc 100644 (file)
 {*                                                                        *}
 {**************************************************************************}
 
-<h2><a href="fusionax">Fusion des annuaires X.org - AX<a> / <a href="fusionax/ids">Identifiants<a> /  Manquants dans l'annuaire de l'AX</h2>
+<h2><a href="fusionax">Fusion des annuaires X.org - AX</a> / <a href="fusionax/ids">Identifiants</a> /  Manquants dans l'annuaire de l'AX</h2>
 
 <p></p>
 
-{if $missingInAX}
-{include file='fusionax/listFusion.tpl' fusionList=$missingInAX field1='user_id' namefield1='ID X.org'}
+{if t($missingInAX)}
+{include file='fusionax/listFusion.tpl' fusionList=$missingInAX field1='pid' namefield1='ID X.org'}
 {/if}
index e817825..f3cd1ba 100644 (file)
 {*                                                                        *}
 {**************************************************************************}
 
-<h2><a href="fusionax">Fusion des annuaires X.org - AX<a> / <a href="fusionax/ids">Identifiants<a> /  Manquants dans l'annuaire d'X.org</h2>
+<h2><a href="fusionax">Fusion des annuaires X.org - AX</a> / <a href="fusionax/ids">Identifiants</a> /  Manquants dans l'annuaire d'X.org</h2>
 
 <p></p>
 
-{if $missingInXorg}
-{include file='fusionax/listFusion.tpl' fusionList=$missingInXorg field1='id_ancien' namefield1='matricule AX'}
+{if t($missingInXorg)}
+{include file='fusionax/listFusion.tpl' fusionList=$missingInXorg field1='ax_id' namefield1='matricule AX'}
 {/if}
index 2deaff4..68829ac 100644 (file)
 {*                                                                        *}
 {**************************************************************************}
 
-<h2><a href="fusionax">Fusion des annuaires X.org - AX<a> / <a href="fusionax/ids">Identifiants<a> /  Présents dans Xorg avec un matricule_ax ne correspondant à rien
+<h2><a href="fusionax">Fusion des annuaires X.org - AX</a> / <a href="fusionax/ids">Identifiants</a> /  Présents dans Xorg avec un matricule_ax ne correspondant à rien
 dans la base de l'AX (mises à part les promo 1921 et 1923 qui ne figurent pas dans les données de l'AX)</h2>
 
 <p></p>
 
-{if $wrongInXorg}
-{include file='fusionax/listFusion.tpl' fusionList=$wrongInXorg field1='user_id' namefield1='ID X.org'}
+{if t($wrongInXorg)}
+{include file='fusionax/listFusion.tpl' fusionList=$wrongInXorg field1='pid' namefield1='ID X.org'}
 
 <p><a href="fusionax/ids/cleanwronginxorg">Mettre à NULL le matricule_ax de ces camarades pour marquer le fait qu'ils ne figurent pas dans l'annuaire de l'AX</a></p>
 {/if}
index e6a0478..814bff5 100644 (file)
@@ -25,9 +25,9 @@
 //<!--
     $(document).ready(function() {
         $('#fusionax_import input').click(function() {
-            $('#fusionax_import input').hide();
-            $('#fusionax_import').append('Lancement de l\'import.<br/>');
-            $.getScript('fusionax/import/launch');
+            $('#fusionax input').hide();
+            $('#fusionax').append('Lancement de l\'import.<br/>');
+            $.getScript('fusionax/import/launch/' + $('#fusionax_filename input').val());
         });
     });
 //-->
 <h2><a href="fusionax">Fusion des annuaires X.org - AX</a></h2>
 
 <h2>Import de l'annuaire AX</h2>
-{if $lastimport}
-<p>Dernier import {$lastimport}</p>
-{/if}
 
-{if $keymissing}
-<p>Impossible de faire l'import, il manque la clef d'authentification :</p>
-<pre>{$keymissing}</pre>
-{else}
-<div id="fusionax_import">
-<input type="button" value="Lancer l'import"/>
-</div>
-{/if}
+<p>
+  Pour pouvoir commencer la fusion des annuaires, un root doit dans un premier
+  temps créer le dossier spool/fusionax avec les droits en lecture et écrire
+  pour l'utilisateur web, puis y déposer l'export fournit par l'AX.<br />
+  Attention, pour faciliter les tests, les tables sont d'abord supprimées avant
+  d'être remplies.<br />
+  De plus la promotion 1920 est aussi ajoutée à notre base.
+</p>
+
+<p>
+  <span id="fusionax">
+    <span id="fusionax_filename"><input type="text" /></span>
+    <span id="fusionax_import"><input type="button" value="Lancer l'import"/></span>
+  </span>
+</p>
 
 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
index 55731d7..351842c 100644 (file)
 {**************************************************************************}
 
 <h2>Fusion des annuaires X.org - AX</h2>
+
+<p>
+  Aucune action n'est lancée depuis cette page. Il faut préalablement aller sur
+  les liens suivants pour effectuer les différentes taches.
+</p>
+
 <ul>
-<li>Voir la <a href="Fusion">documentation</a></li>
-<li><a href="fusionax/import">Import de la base AX</a> {if $lastimport} - (dernier import le {$lastimport}){/if}</li>
-<li>Mise en <a href="fusionax/ids">correspondance simple</a></li>
-<li>Création des <a href="fusionax/view">VIEW annexes nécessaires aux corrélations</a></li>
-<li>Corrélation des <a href="fusionax/deceased">dates de décès</a></li>
-<li>Corrélation des <a href="fusionax/promo">promotions</a></li>
-<li>Corrélation des <a href="fusionax/names">données d'identification</a></li>
-<li>Corrélation des <a href="fusionax/coords">coordonnées</a></li>
-<li>Corrélation des <a href="fusionax/pros">informations professionnelles</a></li>
-<li>Corrélation des <a href="fusionax/studies">informations de formations</a></li>
+  <li>Voir la <a href="Fusion">documentation</a></li>
+  <li><a href="fusionax/import">Import de la base AX</a></li>
+  <li>Préparations des <a href="fusionax/prepare">tables</a></li>
+  <li>Mise en <a href="fusionax/ids">correspondance simple</a></li>
+  <li>Création des <a href="fusionax/view">VIEW annexes nécessaires aux corrélations</a></li>
+  <li>Corrélation des <a href="fusionax/deceased">dates de décès</a></li>
+  <li>Corrélation des <a href="fusionax/promo">promotions</a></li>
+  <li>Corrélation des <a href="fusionax/names">données d'identification</a></li>
+  <li>Corrélation des <a href="fusionax/coords">coordonnées</a></li>
+  <li>Corrélation des <a href="fusionax/pros">informations professionnelles</a></li>
+  <li>Corrélation des <a href="fusionax/studies">informations de formations</a></li>
 </ul>
 
 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
index a46da28..7737a1f 100644 (file)
     <tr>
         <th>Ancien</th>
         <th>Fiches</th>
-        {if $field1}
+        {if t($field1)}
         <th>{$namefield1}</th>
         {/if}
-        {if $field2}
+        {if t($field2)}
         <th>{$namefield2}</th>
         {/if}
-        {if $field3}
+        {if t($field3)}
         <th>{$namefield3}</th>
         {/if}
-        {if $field4}
+        {if t($field4)}
         <th>{$namefield4}</th>
         {/if}
-        {if $fusionAction}
+        {if t($fusionAction)}
         <th>Action</th>
         {/if}
     </tr>
-{if $fusionList}
+{if t($fusionList)}
 {iterate from=$fusionList item=c}
     <tr class="{cycle values="pair,impair"}">
-        <td>{$c.display_name} (X {$c.promo})</td>
+        <td>{$c.private_name} ({$c.promo})</td>
         <td style="text-align:center">
-            {if $c.user_id}<a href="admin/user/{$c.user_id}" class="popup2">{icon name="user_suit" title="Administrer utilisateur"}</a>{/if}
-            {if $c.id_ancien}<a href="http://www.polytechniciens.com/?page=AX_FICHE_ANCIEN&amp;anc_id={$c.id_ancien}" class="popup2">{icon name="user_gray" title="fiche AX"}</a>{/if}
+            {if t($c.pid)}<a href="admin/user/{$c.pid}" class="popup2">{icon name="user_suit" title="Administrer utilisateur"}</a>{/if}
+            {if t($c.ax_id)}<a href="http://www.polytechniciens.com/?page=AX_FICHE_ANCIEN&amp;anc_id={$c.ax_id}" class="popup2">{icon name="user_gray" title="fiche AX"}</a>{/if}
         </td>
-        {if $field1}
+        {if t($field1)}
         <td>{$c.$field1}</td>
         {/if}
-        {if $field2}
+        {if t($field2)}
         <td>{$c.$field2}</td>
         {/if}
-        {if $field3}
+        {if t($field3)}
         <td>{$c.$field3}</td>
         {/if}
-        {if $field4}
+        {if t($field4)}
         <td>{$c.$field4}</td>
         {/if}
-        {if $fusionAction}
-        <td><a class="fusion-action" href="{$fusionAction}/{$c.user_id}/{$c.id_ancien}">{$name}</a></td>
+        {if t($fusionAction)}
+        <td><a class="fusion-action" href="{$fusionAction}/{$c.pid}/{$c.ax_id}">{$name}</a></td>
         {/if}
     </tr>
 {/iterate}
index 7a49350..7d67c0f 100644 (file)
 {if $nbMissmatchingPromos > 0}
 <p>Il y a {$nbMissmatchingPromos} différences entre les deux bases dans pour les promotions.</p>
 <p>Grosses différences (oranjisation ?) :</p>
-{include file='fusionax/listFusion.tpl' fusionList=$missmatchingPromos1 field1='user_id' namefield1='ID X.org' field3='promo_etude_xorg'
+{include file='fusionax/listFusion.tpl' fusionList=$missmatchingPromos1 field1='pid' namefield1='ID X.org' field3='promo_etude_xorg'
 namefield3='etude_xorg' field4='promo_sortie_xorg' namefield4='sortie_xorg' field2='promo_etude_ax' namefield2='etude_ax'}
 
 <p>Petites différences : promo_etude_xorg == promo_etude_ax + 1 et promo_etude_xorg + 3 == promo_sortie_xorg, a priori ce sont les étrangers que nous avons mal
 inclus</p>
-{include file='fusionax/listFusion.tpl' fusionList=$missmatchingPromos2 field1='user_id' namefield1='ID X.org' field3='promo_etude_xorg'
+{include file='fusionax/listFusion.tpl' fusionList=$missmatchingPromos2 field1='pid' namefield1='ID X.org' field3='promo_etude_xorg'
 namefield3='etude_xorg' field4='promo_sortie_xorg' namefield4='sortie_xorg' field2='promo_etude_ax' namefield2='etude_ax'}
 {/if}
index dfa5c6f..ff248a6 100644 (file)
@@ -20,6 +20,6 @@
 {*                                                                        *}
 {**************************************************************************}
 
-<h2><a href="fusionax">Fusion des annuaires X.org - AX<a> / Création des VIEW annexes nécessaires aux corrélations </h2>
+<h2><a href="fusionax">Fusion des annuaires X.org - AX</a> / Création des VIEW annexes nécessaires aux corrélations </h2>
 
 <p><a href="fusionax/view/create">Création des VIEW annexes nécessaires aux corrélations</a></p>
diff --git a/upgrade/1.0.1/14_ax_id.sql b/upgrade/1.0.1/14_ax_id.sql
new file mode 100644 (file)
index 0000000..80a267b
--- /dev/null
@@ -0,0 +1,1090 @@
+UPDATE profiles SET ax_id = 20040027   WHERE pid = 26357;
+UPDATE profiles SET ax_id = 20070459   WHERE pid = 41994;
+UPDATE profiles SET ax_id = 20070093   WHERE pid = 42130;
+UPDATE profiles SET ax_id = 20070118   WHERE pid = 42157;
+UPDATE profiles SET ax_id = 20070239   WHERE pid = 42280;
+UPDATE profiles SET ax_id = 20070481   WHERE pid = 42480;
+UPDATE profiles SET ax_id = 20070488   WHERE pid = 42482;
+UPDATE profiles SET ax_id = 20070490   WHERE pid = 42484;
+UPDATE profiles SET ax_id = 20070491   WHERE pid = 42486;
+UPDATE profiles SET ax_id = 20070492   WHERE pid = 42487;
+UPDATE profiles SET ax_id = 20070500   WHERE pid = 42488;
+UPDATE profiles SET ax_id = 20070501   WHERE pid = 42489;
+UPDATE profiles SET ax_id = 20080007   WHERE pid = 42490;
+UPDATE profiles SET ax_id = 20080010   WHERE pid = 42493;
+UPDATE profiles SET ax_id = 20070508   WHERE pid = 42497;
+UPDATE profiles SET ax_id = 20070509   WHERE pid = 42498;
+UPDATE profiles SET ax_id = 20070510   WHERE pid = 42499;
+UPDATE profiles SET ax_id = 20080016   WHERE pid = 42500;
+UPDATE profiles SET ax_id = 20070514   WHERE pid = 42502;
+UPDATE profiles SET ax_id = 20080019   WHERE pid = 42503;
+UPDATE profiles SET ax_id = 20080021   WHERE pid = 42505;
+UPDATE profiles SET ax_id = 20080493   WHERE pid = 42507;
+UPDATE profiles SET ax_id = 20070524   WHERE pid = 42510;
+UPDATE profiles SET ax_id = 20080025   WHERE pid = 42512;
+UPDATE profiles SET ax_id = 20080027   WHERE pid = 42513;
+UPDATE profiles SET ax_id = 20070525   WHERE pid = 42514;
+UPDATE profiles SET ax_id = 20070527   WHERE pid = 42517;
+UPDATE profiles SET ax_id = 20070532   WHERE pid = 42518;
+UPDATE profiles SET ax_id = 20070533   WHERE pid = 42519;
+UPDATE profiles SET ax_id = 20070534   WHERE pid = 42520;
+UPDATE profiles SET ax_id = 20070536   WHERE pid = 42521;
+UPDATE profiles SET ax_id = 20080031   WHERE pid = 42522;
+UPDATE profiles SET ax_id = 20080032   WHERE pid = 42524;
+UPDATE profiles SET ax_id = 20070542   WHERE pid = 42526;
+UPDATE profiles SET ax_id = 20070541   WHERE pid = 42527;
+UPDATE profiles SET ax_id = 20070545   WHERE pid = 42528;
+UPDATE profiles SET ax_id = 20070547   WHERE pid = 42529;
+UPDATE profiles SET ax_id = 20070548   WHERE pid = 42530;
+UPDATE profiles SET ax_id = 20070549   WHERE pid = 42531;
+UPDATE profiles SET ax_id = 20080015   WHERE pid = 42534;
+UPDATE profiles SET ax_id = 20080029   WHERE pid = 42535;
+UPDATE profiles SET ax_id = 20080034   WHERE pid = 42538;
+UPDATE profiles SET ax_id = 20080033   WHERE pid = 42539;
+UPDATE profiles SET ax_id = 20080014   WHERE pid = 42540;
+UPDATE profiles SET ax_id = 20080017   WHERE pid = 42543;
+UPDATE profiles SET ax_id = 20080036   WHERE pid = 42944;
+UPDATE profiles SET ax_id = 20080037   WHERE pid = 42945;
+UPDATE profiles SET ax_id = 20080038   WHERE pid = 42946;
+UPDATE profiles SET ax_id = 20080039   WHERE pid = 42947;
+UPDATE profiles SET ax_id = 20080040   WHERE pid = 42948;
+UPDATE profiles SET ax_id = 20080041   WHERE pid = 42949;
+UPDATE profiles SET ax_id = 20080042   WHERE pid = 42950;
+UPDATE profiles SET ax_id = 20080043   WHERE pid = 42951;
+UPDATE profiles SET ax_id = 20080044   WHERE pid = 42952;
+UPDATE profiles SET ax_id = 20080045   WHERE pid = 42953;
+UPDATE profiles SET ax_id = 20080046   WHERE pid = 42954;
+UPDATE profiles SET ax_id = 20080047   WHERE pid = 42955;
+UPDATE profiles SET ax_id = 20080048   WHERE pid = 42956;
+UPDATE profiles SET ax_id = 20080049   WHERE pid = 42957;
+UPDATE profiles SET ax_id = 20080050   WHERE pid = 42958;
+UPDATE profiles SET ax_id = 20080051   WHERE pid = 42959;
+UPDATE profiles SET ax_id = 20080052   WHERE pid = 42960;
+UPDATE profiles SET ax_id = 20080053   WHERE pid = 42961;
+UPDATE profiles SET ax_id = 20080054   WHERE pid = 42962;
+UPDATE profiles SET ax_id = 20080055   WHERE pid = 42963;
+UPDATE profiles SET ax_id = 20080056   WHERE pid = 42964;
+UPDATE profiles SET ax_id = 20080057   WHERE pid = 42965;
+UPDATE profiles SET ax_id = 20080058   WHERE pid = 42966;
+UPDATE profiles SET ax_id = 20080059   WHERE pid = 42967;
+UPDATE profiles SET ax_id = 20080060   WHERE pid = 42968;
+UPDATE profiles SET ax_id = 20080061   WHERE pid = 42969;
+UPDATE profiles SET ax_id = 20080062   WHERE pid = 42970;
+UPDATE profiles SET ax_id = 20080063   WHERE pid = 42971;
+UPDATE profiles SET ax_id = 20080064   WHERE pid = 42972;
+UPDATE profiles SET ax_id = 20080065   WHERE pid = 42973;
+UPDATE profiles SET ax_id = 20080066   WHERE pid = 42974;
+UPDATE profiles SET ax_id = 20080067   WHERE pid = 42975;
+UPDATE profiles SET ax_id = 20080068   WHERE pid = 42976;
+UPDATE profiles SET ax_id = 20080069   WHERE pid = 42977;
+UPDATE profiles SET ax_id = 20080070   WHERE pid = 42978;
+UPDATE profiles SET ax_id = 20080071   WHERE pid = 42979;
+UPDATE profiles SET ax_id = 20080072   WHERE pid = 42980;
+UPDATE profiles SET ax_id = 20080073   WHERE pid = 42981;
+UPDATE profiles SET ax_id = 20080074   WHERE pid = 42982;
+UPDATE profiles SET ax_id = 20080075   WHERE pid = 42983;
+UPDATE profiles SET ax_id = 20080076   WHERE pid = 42984;
+UPDATE profiles SET ax_id = 20080077   WHERE pid = 42985;
+UPDATE profiles SET ax_id = 20080078   WHERE pid = 42986;
+UPDATE profiles SET ax_id = 20080079   WHERE pid = 42987;
+UPDATE profiles SET ax_id = 20080080   WHERE pid = 42988;
+UPDATE profiles SET ax_id = 20080081   WHERE pid = 42989;
+UPDATE profiles SET ax_id = 20080082   WHERE pid = 42990;
+UPDATE profiles SET ax_id = 20080083   WHERE pid = 42991;
+UPDATE profiles SET ax_id = 20080084   WHERE pid = 42992;
+UPDATE profiles SET ax_id = 20080085   WHERE pid = 42993;
+UPDATE profiles SET ax_id = 20080086   WHERE pid = 42994;
+UPDATE profiles SET ax_id = 20080087   WHERE pid = 42995;
+UPDATE profiles SET ax_id = 20080088   WHERE pid = 42996;
+UPDATE profiles SET ax_id = 20080089   WHERE pid = 42997;
+UPDATE profiles SET ax_id = 20080090   WHERE pid = 42998;
+UPDATE profiles SET ax_id = 20080091   WHERE pid = 42999;
+UPDATE profiles SET ax_id = 20080092   WHERE pid = 43000;
+UPDATE profiles SET ax_id = 20080093   WHERE pid = 43001;
+UPDATE profiles SET ax_id = 20080094   WHERE pid = 43002;
+UPDATE profiles SET ax_id = 20080095   WHERE pid = 43003;
+UPDATE profiles SET ax_id = 20080097   WHERE pid = 43005;
+UPDATE profiles SET ax_id = 20080098   WHERE pid = 43006;
+UPDATE profiles SET ax_id = 20080099   WHERE pid = 43007;
+UPDATE profiles SET ax_id = 20080101   WHERE pid = 43008;
+UPDATE profiles SET ax_id = 20080102   WHERE pid = 43009;
+UPDATE profiles SET ax_id = 20080103   WHERE pid = 43010;
+UPDATE profiles SET ax_id = 20080104   WHERE pid = 43011;
+UPDATE profiles SET ax_id = 20080105   WHERE pid = 43012;
+UPDATE profiles SET ax_id = 20080106   WHERE pid = 43013;
+UPDATE profiles SET ax_id = 20080107   WHERE pid = 43014;
+UPDATE profiles SET ax_id = 20080108   WHERE pid = 43015;
+UPDATE profiles SET ax_id = 20080109   WHERE pid = 43016;
+UPDATE profiles SET ax_id = 20080110   WHERE pid = 43017;
+UPDATE profiles SET ax_id = 20080111   WHERE pid = 43018;
+UPDATE profiles SET ax_id = 20080112   WHERE pid = 43019;
+UPDATE profiles SET ax_id = 20080113   WHERE pid = 43020;
+UPDATE profiles SET ax_id = 20080114   WHERE pid = 43021;
+UPDATE profiles SET ax_id = 20080115   WHERE pid = 43022;
+UPDATE profiles SET ax_id = 20080116   WHERE pid = 43023;
+UPDATE profiles SET ax_id = 20080117   WHERE pid = 43024;
+UPDATE profiles SET ax_id = 20080118   WHERE pid = 43025;
+UPDATE profiles SET ax_id = 20080119   WHERE pid = 43026;
+UPDATE profiles SET ax_id = 20080120   WHERE pid = 43027;
+UPDATE profiles SET ax_id = 20080121   WHERE pid = 43028;
+UPDATE profiles SET ax_id = 20080122   WHERE pid = 43029;
+UPDATE profiles SET ax_id = 20080123   WHERE pid = 43030;
+UPDATE profiles SET ax_id = 20080124   WHERE pid = 43031;
+UPDATE profiles SET ax_id = 20080125   WHERE pid = 43032;
+UPDATE profiles SET ax_id = 20080126   WHERE pid = 43033;
+UPDATE profiles SET ax_id = 20080127   WHERE pid = 43034;
+UPDATE profiles SET ax_id = 20080128   WHERE pid = 43035;
+UPDATE profiles SET ax_id = 20080129   WHERE pid = 43036;
+UPDATE profiles SET ax_id = 20080130   WHERE pid = 43037;
+UPDATE profiles SET ax_id = 20080131   WHERE pid = 43038;
+UPDATE profiles SET ax_id = 20080132   WHERE pid = 43039;
+UPDATE profiles SET ax_id = 20080133   WHERE pid = 43040;
+UPDATE profiles SET ax_id = 20080134   WHERE pid = 43041;
+UPDATE profiles SET ax_id = 20080135   WHERE pid = 43042;
+UPDATE profiles SET ax_id = 20080136   WHERE pid = 43043;
+UPDATE profiles SET ax_id = 20080137   WHERE pid = 43044;
+UPDATE profiles SET ax_id = 20080138   WHERE pid = 43045;
+UPDATE profiles SET ax_id = 20080139   WHERE pid = 43046;
+UPDATE profiles SET ax_id = 20080140   WHERE pid = 43047;
+UPDATE profiles SET ax_id = 20080141   WHERE pid = 43048;
+UPDATE profiles SET ax_id = 20080142   WHERE pid = 43049;
+UPDATE profiles SET ax_id = 20080143   WHERE pid = 43050;
+UPDATE profiles SET ax_id = 20080100   WHERE pid = 43051;
+UPDATE profiles SET ax_id = 20080266   WHERE pid = 43052;
+UPDATE profiles SET ax_id = 20080422   WHERE pid = 43055;
+UPDATE profiles SET ax_id = 20080144   WHERE pid = 43056;
+UPDATE profiles SET ax_id = 20080425   WHERE pid = 43057;
+UPDATE profiles SET ax_id = 20080145   WHERE pid = 43058;
+UPDATE profiles SET ax_id = 20080146   WHERE pid = 43059;
+UPDATE profiles SET ax_id = 20080147   WHERE pid = 43060;
+UPDATE profiles SET ax_id = 20080148   WHERE pid = 43061;
+UPDATE profiles SET ax_id = 20080149   WHERE pid = 43062;
+UPDATE profiles SET ax_id = 20080150   WHERE pid = 43063;
+UPDATE profiles SET ax_id = 20080151   WHERE pid = 43064;
+UPDATE profiles SET ax_id = 20080152   WHERE pid = 43065;
+UPDATE profiles SET ax_id = 20080153   WHERE pid = 43066;
+UPDATE profiles SET ax_id = 20080154   WHERE pid = 43067;
+UPDATE profiles SET ax_id = 20080155   WHERE pid = 43068;
+UPDATE profiles SET ax_id = 20080156   WHERE pid = 43069;
+UPDATE profiles SET ax_id = 20080157   WHERE pid = 43070;
+UPDATE profiles SET ax_id = 20080158   WHERE pid = 43071;
+UPDATE profiles SET ax_id = 20080159   WHERE pid = 43072;
+UPDATE profiles SET ax_id = 20080160   WHERE pid = 43073;
+UPDATE profiles SET ax_id = 20080161   WHERE pid = 43074;
+UPDATE profiles SET ax_id = 20080162   WHERE pid = 43075;
+UPDATE profiles SET ax_id = 20080163   WHERE pid = 43076;
+UPDATE profiles SET ax_id = 20080164   WHERE pid = 43077;
+UPDATE profiles SET ax_id = 20080359   WHERE pid = 43078;
+UPDATE profiles SET ax_id = 20080165   WHERE pid = 43079;
+UPDATE profiles SET ax_id = 20080166   WHERE pid = 43080;
+UPDATE profiles SET ax_id = 20080167   WHERE pid = 43081;
+UPDATE profiles SET ax_id = 20080168   WHERE pid = 43082;
+UPDATE profiles SET ax_id = 20080169   WHERE pid = 43083;
+UPDATE profiles SET ax_id = 20080170   WHERE pid = 43084;
+UPDATE profiles SET ax_id = 20080171   WHERE pid = 43085;
+UPDATE profiles SET ax_id = 20080172   WHERE pid = 43086;
+UPDATE profiles SET ax_id = 20080173   WHERE pid = 43087;
+UPDATE profiles SET ax_id = 20080174   WHERE pid = 43088;
+UPDATE profiles SET ax_id = 20080175   WHERE pid = 43089;
+UPDATE profiles SET ax_id = 20080176   WHERE pid = 43090;
+UPDATE profiles SET ax_id = 20080177   WHERE pid = 43091;
+UPDATE profiles SET ax_id = 20080178   WHERE pid = 43092;
+UPDATE profiles SET ax_id = 20080179   WHERE pid = 43093;
+UPDATE profiles SET ax_id = 20080180   WHERE pid = 43094;
+UPDATE profiles SET ax_id = 20080181   WHERE pid = 43095;
+UPDATE profiles SET ax_id = 20080182   WHERE pid = 43096;
+UPDATE profiles SET ax_id = 20080183   WHERE pid = 43097;
+UPDATE profiles SET ax_id = 20080184   WHERE pid = 43098;
+UPDATE profiles SET ax_id = 20080185   WHERE pid = 43099;
+UPDATE profiles SET ax_id = 20080186   WHERE pid = 43100;
+UPDATE profiles SET ax_id = 20080187   WHERE pid = 43101;
+UPDATE profiles SET ax_id = 20080188   WHERE pid = 43102;
+UPDATE profiles SET ax_id = 20080189   WHERE pid = 43103;
+UPDATE profiles SET ax_id = 20080190   WHERE pid = 43104;
+UPDATE profiles SET ax_id = 20080191   WHERE pid = 43105;
+UPDATE profiles SET ax_id = 20080192   WHERE pid = 43106;
+UPDATE profiles SET ax_id = 20080193   WHERE pid = 43107;
+UPDATE profiles SET ax_id = 20080194   WHERE pid = 43108;
+UPDATE profiles SET ax_id = 20080195   WHERE pid = 43109;
+UPDATE profiles SET ax_id = 20080196   WHERE pid = 43110;
+UPDATE profiles SET ax_id = 20080197   WHERE pid = 43111;
+UPDATE profiles SET ax_id = 20080198   WHERE pid = 43112;
+UPDATE profiles SET ax_id = 20080199   WHERE pid = 43113;
+UPDATE profiles SET ax_id = 20080200   WHERE pid = 43114;
+UPDATE profiles SET ax_id = 20080201   WHERE pid = 43115;
+UPDATE profiles SET ax_id = 20080202   WHERE pid = 43116;
+UPDATE profiles SET ax_id = 20080203   WHERE pid = 43117;
+UPDATE profiles SET ax_id = 20080204   WHERE pid = 43118;
+UPDATE profiles SET ax_id = 20080205   WHERE pid = 43119;
+UPDATE profiles SET ax_id = 20080206   WHERE pid = 43120;
+UPDATE profiles SET ax_id = 20080207   WHERE pid = 43121;
+UPDATE profiles SET ax_id = 20080208   WHERE pid = 43122;
+UPDATE profiles SET ax_id = 20080209   WHERE pid = 43123;
+UPDATE profiles SET ax_id = 20080210   WHERE pid = 43124;
+UPDATE profiles SET ax_id = 20080211   WHERE pid = 43125;
+UPDATE profiles SET ax_id = 20080212   WHERE pid = 43126;
+UPDATE profiles SET ax_id = 20080213   WHERE pid = 43127;
+UPDATE profiles SET ax_id = 20080214   WHERE pid = 43128;
+UPDATE profiles SET ax_id = 20080215   WHERE pid = 43129;
+UPDATE profiles SET ax_id = 20080216   WHERE pid = 43130;
+UPDATE profiles SET ax_id = 20080217   WHERE pid = 43131;
+UPDATE profiles SET ax_id = 20080218   WHERE pid = 43132;
+UPDATE profiles SET ax_id = 20080219   WHERE pid = 43133;
+UPDATE profiles SET ax_id = 20080220   WHERE pid = 43134;
+UPDATE profiles SET ax_id = 20080221   WHERE pid = 43135;
+UPDATE profiles SET ax_id = 20080222   WHERE pid = 43136;
+UPDATE profiles SET ax_id = 20080223   WHERE pid = 43137;
+UPDATE profiles SET ax_id = 20080224   WHERE pid = 43138;
+UPDATE profiles SET ax_id = 20080225   WHERE pid = 43139;
+UPDATE profiles SET ax_id = 20080226   WHERE pid = 43140;
+UPDATE profiles SET ax_id = 20080227   WHERE pid = 43141;
+UPDATE profiles SET ax_id = 20080228   WHERE pid = 43142;
+UPDATE profiles SET ax_id = 20080229   WHERE pid = 43143;
+UPDATE profiles SET ax_id = 20080230   WHERE pid = 43144;
+UPDATE profiles SET ax_id = 20080231   WHERE pid = 43145;
+UPDATE profiles SET ax_id = 20080232   WHERE pid = 43146;
+UPDATE profiles SET ax_id = 20080233   WHERE pid = 43147;
+UPDATE profiles SET ax_id = 20080234   WHERE pid = 43148;
+UPDATE profiles SET ax_id = 20080235   WHERE pid = 43149;
+UPDATE profiles SET ax_id = 20080236   WHERE pid = 43150;
+UPDATE profiles SET ax_id = 20080237   WHERE pid = 43151;
+UPDATE profiles SET ax_id = 20080238   WHERE pid = 43152;
+UPDATE profiles SET ax_id = 20080239   WHERE pid = 43153;
+UPDATE profiles SET ax_id = 20080240   WHERE pid = 43154;
+UPDATE profiles SET ax_id = 20080241   WHERE pid = 43155;
+UPDATE profiles SET ax_id = 20080242   WHERE pid = 43156;
+UPDATE profiles SET ax_id = 20080243   WHERE pid = 43157;
+UPDATE profiles SET ax_id = 20080244   WHERE pid = 43158;
+UPDATE profiles SET ax_id = 20080245   WHERE pid = 43159;
+UPDATE profiles SET ax_id = 20080246   WHERE pid = 43160;
+UPDATE profiles SET ax_id = 20080247   WHERE pid = 43161;
+UPDATE profiles SET ax_id = 20080248   WHERE pid = 43162;
+UPDATE profiles SET ax_id = 20080249   WHERE pid = 43163;
+UPDATE profiles SET ax_id = 20080250   WHERE pid = 43164;
+UPDATE profiles SET ax_id = 20080251   WHERE pid = 43165;
+UPDATE profiles SET ax_id = 20080252   WHERE pid = 43166;
+UPDATE profiles SET ax_id = 20080253   WHERE pid = 43167;
+UPDATE profiles SET ax_id = 20080254   WHERE pid = 43168;
+UPDATE profiles SET ax_id = 20080256   WHERE pid = 43169;
+UPDATE profiles SET ax_id = 20080257   WHERE pid = 43170;
+UPDATE profiles SET ax_id = 20080258   WHERE pid = 43171;
+UPDATE profiles SET ax_id = 20080259   WHERE pid = 43172;
+UPDATE profiles SET ax_id = 20080260   WHERE pid = 43173;
+UPDATE profiles SET ax_id = 20080261   WHERE pid = 43174;
+UPDATE profiles SET ax_id = 20080295   WHERE pid = 43175;
+UPDATE profiles SET ax_id = 20080262   WHERE pid = 43176;
+UPDATE profiles SET ax_id = 20080263   WHERE pid = 43177;
+UPDATE profiles SET ax_id = 20080264   WHERE pid = 43178;
+UPDATE profiles SET ax_id = 20080265   WHERE pid = 43179;
+UPDATE profiles SET ax_id = 20080268   WHERE pid = 43181;
+UPDATE profiles SET ax_id = 20080269   WHERE pid = 43182;
+UPDATE profiles SET ax_id = 20080270   WHERE pid = 43183;
+UPDATE profiles SET ax_id = 20080271   WHERE pid = 43184;
+UPDATE profiles SET ax_id = 20080272   WHERE pid = 43185;
+UPDATE profiles SET ax_id = 20080275   WHERE pid = 43186;
+UPDATE profiles SET ax_id = 20080276   WHERE pid = 43187;
+UPDATE profiles SET ax_id = 20080277   WHERE pid = 43188;
+UPDATE profiles SET ax_id = 20080278   WHERE pid = 43189;
+UPDATE profiles SET ax_id = 20080279   WHERE pid = 43190;
+UPDATE profiles SET ax_id = 20080280   WHERE pid = 43191;
+UPDATE profiles SET ax_id = 20080281   WHERE pid = 43192;
+UPDATE profiles SET ax_id = 20080282   WHERE pid = 43193;
+UPDATE profiles SET ax_id = 20080283   WHERE pid = 43194;
+UPDATE profiles SET ax_id = 20080284   WHERE pid = 43195;
+UPDATE profiles SET ax_id = 20080285   WHERE pid = 43196;
+UPDATE profiles SET ax_id = 20080286   WHERE pid = 43197;
+UPDATE profiles SET ax_id = 20080287   WHERE pid = 43198;
+UPDATE profiles SET ax_id = 20080288   WHERE pid = 43199;
+UPDATE profiles SET ax_id = 20080289   WHERE pid = 43200;
+UPDATE profiles SET ax_id = 20080290   WHERE pid = 43201;
+UPDATE profiles SET ax_id = 20080292   WHERE pid = 43203;
+UPDATE profiles SET ax_id = 20080293   WHERE pid = 43204;
+UPDATE profiles SET ax_id = 20080294   WHERE pid = 43205;
+UPDATE profiles SET ax_id = 20080296   WHERE pid = 43206;
+UPDATE profiles SET ax_id = 20080297   WHERE pid = 43207;
+UPDATE profiles SET ax_id = 20080298   WHERE pid = 43208;
+UPDATE profiles SET ax_id = 20080299   WHERE pid = 43209;
+UPDATE profiles SET ax_id = 20080300   WHERE pid = 43210;
+UPDATE profiles SET ax_id = 20080301   WHERE pid = 43211;
+UPDATE profiles SET ax_id = 20080302   WHERE pid = 43212;
+UPDATE profiles SET ax_id = 20080303   WHERE pid = 43213;
+UPDATE profiles SET ax_id = 20080304   WHERE pid = 43214;
+UPDATE profiles SET ax_id = 20080305   WHERE pid = 43215;
+UPDATE profiles SET ax_id = 20080306   WHERE pid = 43216;
+UPDATE profiles SET ax_id = 20080307   WHERE pid = 43217;
+UPDATE profiles SET ax_id = 20080308   WHERE pid = 43218;
+UPDATE profiles SET ax_id = 20080309   WHERE pid = 43219;
+UPDATE profiles SET ax_id = 20080310   WHERE pid = 43220;
+UPDATE profiles SET ax_id = 20080311   WHERE pid = 43221;
+UPDATE profiles SET ax_id = 20080312   WHERE pid = 43222;
+UPDATE profiles SET ax_id = 20080313   WHERE pid = 43223;
+UPDATE profiles SET ax_id = 20080314   WHERE pid = 43224;
+UPDATE profiles SET ax_id = 20080315   WHERE pid = 43225;
+UPDATE profiles SET ax_id = 20080316   WHERE pid = 43226;
+UPDATE profiles SET ax_id = 20080317   WHERE pid = 43227;
+UPDATE profiles SET ax_id = 20080318   WHERE pid = 43228;
+UPDATE profiles SET ax_id = 20080319   WHERE pid = 43229;
+UPDATE profiles SET ax_id = 20080320   WHERE pid = 43230;
+UPDATE profiles SET ax_id = 20080321   WHERE pid = 43231;
+UPDATE profiles SET ax_id = 20080322   WHERE pid = 43232;
+UPDATE profiles SET ax_id = 20080323   WHERE pid = 43233;
+UPDATE profiles SET ax_id = 20080324   WHERE pid = 43234;
+UPDATE profiles SET ax_id = 20080325   WHERE pid = 43235;
+UPDATE profiles SET ax_id = 20080326   WHERE pid = 43236;
+UPDATE profiles SET ax_id = 20080327   WHERE pid = 43237;
+UPDATE profiles SET ax_id = 20080328   WHERE pid = 43238;
+UPDATE profiles SET ax_id = 20080329   WHERE pid = 43239;
+UPDATE profiles SET ax_id = 20080330   WHERE pid = 43240;
+UPDATE profiles SET ax_id = 20080331   WHERE pid = 43241;
+UPDATE profiles SET ax_id = 20080332   WHERE pid = 43242;
+UPDATE profiles SET ax_id = 20080333   WHERE pid = 43243;
+UPDATE profiles SET ax_id = 20080334   WHERE pid = 43244;
+UPDATE profiles SET ax_id = 20080335   WHERE pid = 43245;
+UPDATE profiles SET ax_id = 20080336   WHERE pid = 43246;
+UPDATE profiles SET ax_id = 20080337   WHERE pid = 43247;
+UPDATE profiles SET ax_id = 20080338   WHERE pid = 43248;
+UPDATE profiles SET ax_id = 20080339   WHERE pid = 43249;
+UPDATE profiles SET ax_id = 20080340   WHERE pid = 43250;
+UPDATE profiles SET ax_id = 20080341   WHERE pid = 43251;
+UPDATE profiles SET ax_id = 20080342   WHERE pid = 43252;
+UPDATE profiles SET ax_id = 20080343   WHERE pid = 43253;
+UPDATE profiles SET ax_id = 20080344   WHERE pid = 43254;
+UPDATE profiles SET ax_id = 20080345   WHERE pid = 43255;
+UPDATE profiles SET ax_id = 20080346   WHERE pid = 43256;
+UPDATE profiles SET ax_id = 20080347   WHERE pid = 43257;
+UPDATE profiles SET ax_id = 20080348   WHERE pid = 43258;
+UPDATE profiles SET ax_id = 20080349   WHERE pid = 43259;
+UPDATE profiles SET ax_id = 20080350   WHERE pid = 43260;
+UPDATE profiles SET ax_id = 20080351   WHERE pid = 43261;
+UPDATE profiles SET ax_id = 20080352   WHERE pid = 43262;
+UPDATE profiles SET ax_id = 20080353   WHERE pid = 43263;
+UPDATE profiles SET ax_id = 20080355   WHERE pid = 43264;
+UPDATE profiles SET ax_id = 20080354   WHERE pid = 43265;
+UPDATE profiles SET ax_id = 20080356   WHERE pid = 43266;
+UPDATE profiles SET ax_id = 20080357   WHERE pid = 43267;
+UPDATE profiles SET ax_id = 20080358   WHERE pid = 43268;
+UPDATE profiles SET ax_id = 20080360   WHERE pid = 43269;
+UPDATE profiles SET ax_id = 20080361   WHERE pid = 43270;
+UPDATE profiles SET ax_id = 20080362   WHERE pid = 43271;
+UPDATE profiles SET ax_id = 20080363   WHERE pid = 43272;
+UPDATE profiles SET ax_id = 20080364   WHERE pid = 43273;
+UPDATE profiles SET ax_id = 20080365   WHERE pid = 43274;
+UPDATE profiles SET ax_id = 20080366   WHERE pid = 43275;
+UPDATE profiles SET ax_id = 20080367   WHERE pid = 43276;
+UPDATE profiles SET ax_id = 20080368   WHERE pid = 43277;
+UPDATE profiles SET ax_id = 20080369   WHERE pid = 43278;
+UPDATE profiles SET ax_id = 20080370   WHERE pid = 43279;
+UPDATE profiles SET ax_id = 20080371   WHERE pid = 43280;
+UPDATE profiles SET ax_id = 20080372   WHERE pid = 43281;
+UPDATE profiles SET ax_id = 20080373   WHERE pid = 43282;
+UPDATE profiles SET ax_id = 20080374   WHERE pid = 43283;
+UPDATE profiles SET ax_id = 20080375   WHERE pid = 43284;
+UPDATE profiles SET ax_id = 20080376   WHERE pid = 43285;
+UPDATE profiles SET ax_id = 20080377   WHERE pid = 43286;
+UPDATE profiles SET ax_id = 20080378   WHERE pid = 43287;
+UPDATE profiles SET ax_id = 20080379   WHERE pid = 43288;
+UPDATE profiles SET ax_id = 20080380   WHERE pid = 43289;
+UPDATE profiles SET ax_id = 20080381   WHERE pid = 43290;
+UPDATE profiles SET ax_id = 20080382   WHERE pid = 43291;
+UPDATE profiles SET ax_id = 20080383   WHERE pid = 43292;
+UPDATE profiles SET ax_id = 20080384   WHERE pid = 43293;
+UPDATE profiles SET ax_id = 20080385   WHERE pid = 43294;
+UPDATE profiles SET ax_id = 20080386   WHERE pid = 43295;
+UPDATE profiles SET ax_id = 20080387   WHERE pid = 43296;
+UPDATE profiles SET ax_id = 20080388   WHERE pid = 43297;
+UPDATE profiles SET ax_id = 20080389   WHERE pid = 43298;
+UPDATE profiles SET ax_id = 20080390   WHERE pid = 43299;
+UPDATE profiles SET ax_id = 20080391   WHERE pid = 43300;
+UPDATE profiles SET ax_id = 20080392   WHERE pid = 43301;
+UPDATE profiles SET ax_id = 20080393   WHERE pid = 43302;
+UPDATE profiles SET ax_id = 20080394   WHERE pid = 43303;
+UPDATE profiles SET ax_id = 20080395   WHERE pid = 43304;
+UPDATE profiles SET ax_id = 20080396   WHERE pid = 43305;
+UPDATE profiles SET ax_id = 20080397   WHERE pid = 43306;
+UPDATE profiles SET ax_id = 20080398   WHERE pid = 43307;
+UPDATE profiles SET ax_id = 20080399   WHERE pid = 43308;
+UPDATE profiles SET ax_id = 20080400   WHERE pid = 43309;
+UPDATE profiles SET ax_id = 20080401   WHERE pid = 43310;
+UPDATE profiles SET ax_id = 20080402   WHERE pid = 43311;
+UPDATE profiles SET ax_id = 20080403   WHERE pid = 43312;
+UPDATE profiles SET ax_id = 20080404   WHERE pid = 43313;
+UPDATE profiles SET ax_id = 20080405   WHERE pid = 43314;
+UPDATE profiles SET ax_id = 20080406   WHERE pid = 43315;
+UPDATE profiles SET ax_id = 20080407   WHERE pid = 43316;
+UPDATE profiles SET ax_id = 20080408   WHERE pid = 43317;
+UPDATE profiles SET ax_id = 20080409   WHERE pid = 43318;
+UPDATE profiles SET ax_id = 20080410   WHERE pid = 43319;
+UPDATE profiles SET ax_id = 20080411   WHERE pid = 43320;
+UPDATE profiles SET ax_id = 20080412   WHERE pid = 43321;
+UPDATE profiles SET ax_id = 20080413   WHERE pid = 43322;
+UPDATE profiles SET ax_id = 20080414   WHERE pid = 43323;
+UPDATE profiles SET ax_id = 20080415   WHERE pid = 43324;
+UPDATE profiles SET ax_id = 20080416   WHERE pid = 43325;
+UPDATE profiles SET ax_id = 20080417   WHERE pid = 43326;
+UPDATE profiles SET ax_id = 20080418   WHERE pid = 43327;
+UPDATE profiles SET ax_id = 20080419   WHERE pid = 43328;
+UPDATE profiles SET ax_id = 20080420   WHERE pid = 43329;
+UPDATE profiles SET ax_id = 20080421   WHERE pid = 43330;
+UPDATE profiles SET ax_id = 20080423   WHERE pid = 43331;
+UPDATE profiles SET ax_id = 20080424   WHERE pid = 43332;
+UPDATE profiles SET ax_id = 20080426   WHERE pid = 43333;
+UPDATE profiles SET ax_id = 20080427   WHERE pid = 43334;
+UPDATE profiles SET ax_id = 20080429   WHERE pid = 43336;
+UPDATE profiles SET ax_id = 20080430   WHERE pid = 43337;
+UPDATE profiles SET ax_id = 20080431   WHERE pid = 43338;
+UPDATE profiles SET ax_id = 20080432   WHERE pid = 43339;
+UPDATE profiles SET ax_id = 20080433   WHERE pid = 43340;
+UPDATE profiles SET ax_id = 20080434   WHERE pid = 43341;
+UPDATE profiles SET ax_id = 20080435   WHERE pid = 43342;
+UPDATE profiles SET ax_id = 20080471   WHERE pid = 43343;
+UPDATE profiles SET ax_id = 20080472   WHERE pid = 43346;
+UPDATE profiles SET ax_id = 20090003   WHERE pid = 43347;
+UPDATE profiles SET ax_id = 20080473   WHERE pid = 43348;
+UPDATE profiles SET ax_id = 20090004   WHERE pid = 43349;
+UPDATE profiles SET ax_id = 20090005   WHERE pid = 43350;
+UPDATE profiles SET ax_id = 20080474   WHERE pid = 43351;
+UPDATE profiles SET ax_id = 20080475   WHERE pid = 43352;
+UPDATE profiles SET ax_id = 20090006   WHERE pid = 43353;
+UPDATE profiles SET ax_id = 20090007   WHERE pid = 43354;
+UPDATE profiles SET ax_id = 20080477   WHERE pid = 43355;
+UPDATE profiles SET ax_id = 20080476   WHERE pid = 43356;
+UPDATE profiles SET ax_id = 20090008   WHERE pid = 43359;
+UPDATE profiles SET ax_id = 20080480   WHERE pid = 43360;
+UPDATE profiles SET ax_id = 20080481   WHERE pid = 43361;
+UPDATE profiles SET ax_id = 20080482   WHERE pid = 43362;
+UPDATE profiles SET ax_id = 20080485   WHERE pid = 43364;
+UPDATE profiles SET ax_id = 20080484   WHERE pid = 43365;
+UPDATE profiles SET ax_id = 20090009   WHERE pid = 43366;
+UPDATE profiles SET ax_id = 20090010   WHERE pid = 43367;
+UPDATE profiles SET ax_id = 20080486   WHERE pid = 43369;
+UPDATE profiles SET ax_id = 20090011   WHERE pid = 43370;
+UPDATE profiles SET ax_id = 20090012   WHERE pid = 43371;
+UPDATE profiles SET ax_id = 20080487   WHERE pid = 43372;
+UPDATE profiles SET ax_id = 20080488   WHERE pid = 43374;
+UPDATE profiles SET ax_id = 20090014   WHERE pid = 43375;
+UPDATE profiles SET ax_id = 20080489   WHERE pid = 43376;
+UPDATE profiles SET ax_id = 20090015   WHERE pid = 43377;
+UPDATE profiles SET ax_id = 20080491   WHERE pid = 43379;
+UPDATE profiles SET ax_id = 20080492   WHERE pid = 43380;
+UPDATE profiles SET ax_id = 20090016   WHERE pid = 43381;
+UPDATE profiles SET ax_id = 20090018   WHERE pid = 43383;
+UPDATE profiles SET ax_id = 20090019   WHERE pid = 43384;
+UPDATE profiles SET ax_id = 20090020   WHERE pid = 43385;
+UPDATE profiles SET ax_id = 20090021   WHERE pid = 43388;
+UPDATE profiles SET ax_id = 20090022   WHERE pid = 43390;
+UPDATE profiles SET ax_id = 20090023   WHERE pid = 43391;
+UPDATE profiles SET ax_id = 20080497   WHERE pid = 43392;
+UPDATE profiles SET ax_id = 20080498   WHERE pid = 43393;
+UPDATE profiles SET ax_id = 20090024   WHERE pid = 43394;
+UPDATE profiles SET ax_id = 20080499   WHERE pid = 43395;
+UPDATE profiles SET ax_id = 20090025   WHERE pid = 43396;
+UPDATE profiles SET ax_id = 20090027   WHERE pid = 43398;
+UPDATE profiles SET ax_id = 20080502   WHERE pid = 43401;
+UPDATE profiles SET ax_id = 20080503   WHERE pid = 43402;
+UPDATE profiles SET ax_id = 20080504   WHERE pid = 43404;
+UPDATE profiles SET ax_id = 20080505   WHERE pid = 43405;
+UPDATE profiles SET ax_id = 20080507   WHERE pid = 43406;
+UPDATE profiles SET ax_id = 20080506   WHERE pid = 43407;
+UPDATE profiles SET ax_id = 20080508   WHERE pid = 43408;
+UPDATE profiles SET ax_id = 20080509   WHERE pid = 43409;
+UPDATE profiles SET ax_id = 20080510   WHERE pid = 43410;
+UPDATE profiles SET ax_id = 20090031   WHERE pid = 43411;
+UPDATE profiles SET ax_id = 20090030   WHERE pid = 43412;
+UPDATE profiles SET ax_id = 20080255   WHERE pid = 43413;
+UPDATE profiles SET ax_id = 20080436   WHERE pid = 43414;
+UPDATE profiles SET ax_id = 20080437   WHERE pid = 43415;
+UPDATE profiles SET ax_id = 20080438   WHERE pid = 43416;
+UPDATE profiles SET ax_id = 20080439   WHERE pid = 43417;
+UPDATE profiles SET ax_id = 20080440   WHERE pid = 43418;
+UPDATE profiles SET ax_id = 20080441   WHERE pid = 43419;
+UPDATE profiles SET ax_id = 20080442   WHERE pid = 43420;
+UPDATE profiles SET ax_id = 20080443   WHERE pid = 43421;
+UPDATE profiles SET ax_id = 20080444   WHERE pid = 43422;
+UPDATE profiles SET ax_id = 20080445   WHERE pid = 43423;
+UPDATE profiles SET ax_id = 20080446   WHERE pid = 43424;
+UPDATE profiles SET ax_id = 20080447   WHERE pid = 43425;
+UPDATE profiles SET ax_id = 20080448   WHERE pid = 43426;
+UPDATE profiles SET ax_id = 20080449   WHERE pid = 43427;
+UPDATE profiles SET ax_id = 20080450   WHERE pid = 43428;
+UPDATE profiles SET ax_id = 20080451   WHERE pid = 43429;
+UPDATE profiles SET ax_id = 20080452   WHERE pid = 43430;
+UPDATE profiles SET ax_id = 20080453   WHERE pid = 43431;
+UPDATE profiles SET ax_id = 20080454   WHERE pid = 43432;
+UPDATE profiles SET ax_id = 20080455   WHERE pid = 43433;
+UPDATE profiles SET ax_id = 20080456   WHERE pid = 43434;
+UPDATE profiles SET ax_id = 20080457   WHERE pid = 43435;
+UPDATE profiles SET ax_id = 20080458   WHERE pid = 43436;
+UPDATE profiles SET ax_id = 20080459   WHERE pid = 43437;
+UPDATE profiles SET ax_id = 20080460   WHERE pid = 43438;
+UPDATE profiles SET ax_id = 20080461   WHERE pid = 43439;
+UPDATE profiles SET ax_id = 20080462   WHERE pid = 43440;
+UPDATE profiles SET ax_id = 20080463   WHERE pid = 43441;
+UPDATE profiles SET ax_id = 20080464   WHERE pid = 43442;
+UPDATE profiles SET ax_id = 20080465   WHERE pid = 43443;
+UPDATE profiles SET ax_id = 20080468   WHERE pid = 43446;
+UPDATE profiles SET ax_id = 20080469   WHERE pid = 43447;
+UPDATE profiles SET ax_id = 20080470   WHERE pid = 43448;
+UPDATE profiles SET ax_id = 20090433   WHERE pid = 43450;
+UPDATE profiles SET ax_id = 20090432   WHERE pid = 43451;
+UPDATE profiles SET ax_id = 20090032   WHERE pid = 43452;
+UPDATE profiles SET ax_id = 20090033   WHERE pid = 43453;
+UPDATE profiles SET ax_id = 20090034   WHERE pid = 43454;
+UPDATE profiles SET ax_id = 20090035   WHERE pid = 43455;
+UPDATE profiles SET ax_id = 20090036   WHERE pid = 43456;
+UPDATE profiles SET ax_id = 20090037   WHERE pid = 43457;
+UPDATE profiles SET ax_id = 20090038   WHERE pid = 43458;
+UPDATE profiles SET ax_id = 20090434   WHERE pid = 43459;
+UPDATE profiles SET ax_id = 20090435   WHERE pid = 43460;
+UPDATE profiles SET ax_id = 20090436   WHERE pid = 43461;
+UPDATE profiles SET ax_id = 20090437   WHERE pid = 43462;
+UPDATE profiles SET ax_id = 20090039   WHERE pid = 43463;
+UPDATE profiles SET ax_id = 20090040   WHERE pid = 43464;
+UPDATE profiles SET ax_id = 20090041   WHERE pid = 43465;
+UPDATE profiles SET ax_id = 20090042   WHERE pid = 43466;
+UPDATE profiles SET ax_id = 20090043   WHERE pid = 43467;
+UPDATE profiles SET ax_id = 20090044   WHERE pid = 43468;
+UPDATE profiles SET ax_id = 20090045   WHERE pid = 43469;
+UPDATE profiles SET ax_id = 20090046   WHERE pid = 43470;
+UPDATE profiles SET ax_id = 20090047   WHERE pid = 43471;
+UPDATE profiles SET ax_id = 20090048   WHERE pid = 43472;
+UPDATE profiles SET ax_id = 20090049   WHERE pid = 43473;
+UPDATE profiles SET ax_id = 20090050   WHERE pid = 43474;
+UPDATE profiles SET ax_id = 20090051   WHERE pid = 43475;
+UPDATE profiles SET ax_id = 20090052   WHERE pid = 43476;
+UPDATE profiles SET ax_id = 20090053   WHERE pid = 43477;
+UPDATE profiles SET ax_id = 20090054   WHERE pid = 43478;
+UPDATE profiles SET ax_id = 20090056   WHERE pid = 43479;
+UPDATE profiles SET ax_id = 20090057   WHERE pid = 43480;
+UPDATE profiles SET ax_id = 20090059   WHERE pid = 43481;
+UPDATE profiles SET ax_id = 20090058   WHERE pid = 43482;
+UPDATE profiles SET ax_id = 20090438   WHERE pid = 43483;
+UPDATE profiles SET ax_id = 20090060   WHERE pid = 43484;
+UPDATE profiles SET ax_id = 20090061   WHERE pid = 43485;
+UPDATE profiles SET ax_id = 20090062   WHERE pid = 43486;
+UPDATE profiles SET ax_id = 20090063   WHERE pid = 43487;
+UPDATE profiles SET ax_id = 20090064   WHERE pid = 43488;
+UPDATE profiles SET ax_id = 20090065   WHERE pid = 43489;
+UPDATE profiles SET ax_id = 20090066   WHERE pid = 43490;
+UPDATE profiles SET ax_id = 20090067   WHERE pid = 43491;
+UPDATE profiles SET ax_id = 20090068   WHERE pid = 43492;
+UPDATE profiles SET ax_id = 20090069   WHERE pid = 43493;
+UPDATE profiles SET ax_id = 20090439   WHERE pid = 43494;
+UPDATE profiles SET ax_id = 20090070   WHERE pid = 43495;
+UPDATE profiles SET ax_id = 20090071   WHERE pid = 43496;
+UPDATE profiles SET ax_id = 20090072   WHERE pid = 43497;
+UPDATE profiles SET ax_id = 20090073   WHERE pid = 43498;
+UPDATE profiles SET ax_id = 20090074   WHERE pid = 43499;
+UPDATE profiles SET ax_id = 20090075   WHERE pid = 43500;
+UPDATE profiles SET ax_id = 20090076   WHERE pid = 43501;
+UPDATE profiles SET ax_id = 20090077   WHERE pid = 43502;
+UPDATE profiles SET ax_id = 20090078   WHERE pid = 43503;
+UPDATE profiles SET ax_id = 20090079   WHERE pid = 43504;
+UPDATE profiles SET ax_id = 20090080   WHERE pid = 43505;
+UPDATE profiles SET ax_id = 20090081   WHERE pid = 43506;
+UPDATE profiles SET ax_id = 20090082   WHERE pid = 43507;
+UPDATE profiles SET ax_id = 20090083   WHERE pid = 43508;
+UPDATE profiles SET ax_id = 20090084   WHERE pid = 43509;
+UPDATE profiles SET ax_id = 20090085   WHERE pid = 43510;
+UPDATE profiles SET ax_id = 20090086   WHERE pid = 43511;
+UPDATE profiles SET ax_id = 20090087   WHERE pid = 43512;
+UPDATE profiles SET ax_id = 20090088   WHERE pid = 43513;
+UPDATE profiles SET ax_id = 20090089   WHERE pid = 43514;
+UPDATE profiles SET ax_id = 20090090   WHERE pid = 43515;
+UPDATE profiles SET ax_id = 20090092   WHERE pid = 43516;
+UPDATE profiles SET ax_id = 20090091   WHERE pid = 43517;
+UPDATE profiles SET ax_id = 20090094   WHERE pid = 43519;
+UPDATE profiles SET ax_id = 20090095   WHERE pid = 43520;
+UPDATE profiles SET ax_id = 20090096   WHERE pid = 43521;
+UPDATE profiles SET ax_id = 20090097   WHERE pid = 43522;
+UPDATE profiles SET ax_id = 20090098   WHERE pid = 43523;
+UPDATE profiles SET ax_id = 20090440   WHERE pid = 43524;
+UPDATE profiles SET ax_id = 20090099   WHERE pid = 43525;
+UPDATE profiles SET ax_id = 20090100   WHERE pid = 43526;
+UPDATE profiles SET ax_id = 20090101   WHERE pid = 43527;
+UPDATE profiles SET ax_id = 20090102   WHERE pid = 43528;
+UPDATE profiles SET ax_id = 20090103   WHERE pid = 43529;
+UPDATE profiles SET ax_id = 20090104   WHERE pid = 43530;
+UPDATE profiles SET ax_id = 20090105   WHERE pid = 43531;
+UPDATE profiles SET ax_id = 20090106   WHERE pid = 43532;
+UPDATE profiles SET ax_id = 20090107   WHERE pid = 43533;
+UPDATE profiles SET ax_id = 20090441   WHERE pid = 43534;
+UPDATE profiles SET ax_id = 20090108   WHERE pid = 43535;
+UPDATE profiles SET ax_id = 20090442   WHERE pid = 43536;
+UPDATE profiles SET ax_id = 20090109   WHERE pid = 43537;
+UPDATE profiles SET ax_id = 20090443   WHERE pid = 43538;
+UPDATE profiles SET ax_id = 20090110   WHERE pid = 43539;
+UPDATE profiles SET ax_id = 20090444   WHERE pid = 43540;
+UPDATE profiles SET ax_id = 20090111   WHERE pid = 43541;
+UPDATE profiles SET ax_id = 20090112   WHERE pid = 43542;
+UPDATE profiles SET ax_id = 20090113   WHERE pid = 43543;
+UPDATE profiles SET ax_id = 20090114   WHERE pid = 43544;
+UPDATE profiles SET ax_id = 20090115   WHERE pid = 43545;
+UPDATE profiles SET ax_id = 20090116   WHERE pid = 43546;
+UPDATE profiles SET ax_id = 20090117   WHERE pid = 43547;
+UPDATE profiles SET ax_id = 20090118   WHERE pid = 43548;
+UPDATE profiles SET ax_id = 20090119   WHERE pid = 43549;
+UPDATE profiles SET ax_id = 20090120   WHERE pid = 43550;
+UPDATE profiles SET ax_id = 20090445   WHERE pid = 43551;
+UPDATE profiles SET ax_id = 20090121   WHERE pid = 43552;
+UPDATE profiles SET ax_id = 20090122   WHERE pid = 43553;
+UPDATE profiles SET ax_id = 20090123   WHERE pid = 43554;
+UPDATE profiles SET ax_id = 20090124   WHERE pid = 43555;
+UPDATE profiles SET ax_id = 20090125   WHERE pid = 43556;
+UPDATE profiles SET ax_id = 20090126   WHERE pid = 43557;
+UPDATE profiles SET ax_id = 20090127   WHERE pid = 43558;
+UPDATE profiles SET ax_id = 20090128   WHERE pid = 43559;
+UPDATE profiles SET ax_id = 20090129   WHERE pid = 43560;
+UPDATE profiles SET ax_id = 20090130   WHERE pid = 43561;
+UPDATE profiles SET ax_id = 20090131   WHERE pid = 43562;
+UPDATE profiles SET ax_id = 20090132   WHERE pid = 43563;
+UPDATE profiles SET ax_id = 20090133   WHERE pid = 43564;
+UPDATE profiles SET ax_id = 20090446   WHERE pid = 43565;
+UPDATE profiles SET ax_id = 20090055   WHERE pid = 43566;
+UPDATE profiles SET ax_id = 20090134   WHERE pid = 43567;
+UPDATE profiles SET ax_id = 20090135   WHERE pid = 43569;
+UPDATE profiles SET ax_id = 20090136   WHERE pid = 43570;
+UPDATE profiles SET ax_id = 20090137   WHERE pid = 43571;
+UPDATE profiles SET ax_id = 20090138   WHERE pid = 43572;
+UPDATE profiles SET ax_id = 20090139   WHERE pid = 43573;
+UPDATE profiles SET ax_id = 20090140   WHERE pid = 43574;
+UPDATE profiles SET ax_id = 20090253   WHERE pid = 43575;
+UPDATE profiles SET ax_id = 20090141   WHERE pid = 43576;
+UPDATE profiles SET ax_id = 20090142   WHERE pid = 43577;
+UPDATE profiles SET ax_id = 20090143   WHERE pid = 43578;
+UPDATE profiles SET ax_id = 20090144   WHERE pid = 43579;
+UPDATE profiles SET ax_id = 20090145   WHERE pid = 43580;
+UPDATE profiles SET ax_id = 20090281   WHERE pid = 43581;
+UPDATE profiles SET ax_id = 20090297   WHERE pid = 43582;
+UPDATE profiles SET ax_id = 20090312   WHERE pid = 43583;
+UPDATE profiles SET ax_id = 20090146   WHERE pid = 43584;
+UPDATE profiles SET ax_id = 20090447   WHERE pid = 43585;
+UPDATE profiles SET ax_id = 20090147   WHERE pid = 43586;
+UPDATE profiles SET ax_id = 20090448   WHERE pid = 43587;
+UPDATE profiles SET ax_id = 20090148   WHERE pid = 43588;
+UPDATE profiles SET ax_id = 20090418   WHERE pid = 43589;
+UPDATE profiles SET ax_id = 20090149   WHERE pid = 43590;
+UPDATE profiles SET ax_id = 20090150   WHERE pid = 43591;
+UPDATE profiles SET ax_id = 20090151   WHERE pid = 43592;
+UPDATE profiles SET ax_id = 20090152   WHERE pid = 43593;
+UPDATE profiles SET ax_id = 20090449   WHERE pid = 43594;
+UPDATE profiles SET ax_id = 20090153   WHERE pid = 43595;
+UPDATE profiles SET ax_id = 20090154   WHERE pid = 43596;
+UPDATE profiles SET ax_id = 20090155   WHERE pid = 43597;
+UPDATE profiles SET ax_id = 20090156   WHERE pid = 43598;
+UPDATE profiles SET ax_id = 20090157   WHERE pid = 43599;
+UPDATE profiles SET ax_id = 20090159   WHERE pid = 43600;
+UPDATE profiles SET ax_id = 20090161   WHERE pid = 43601;
+UPDATE profiles SET ax_id = 20090160   WHERE pid = 43602;
+UPDATE profiles SET ax_id = 20090162   WHERE pid = 43603;
+UPDATE profiles SET ax_id = 20090163   WHERE pid = 43604;
+UPDATE profiles SET ax_id = 20090164   WHERE pid = 43605;
+UPDATE profiles SET ax_id = 20090165   WHERE pid = 43606;
+UPDATE profiles SET ax_id = 20090450   WHERE pid = 43607;
+UPDATE profiles SET ax_id = 20090166   WHERE pid = 43608;
+UPDATE profiles SET ax_id = 20090167   WHERE pid = 43609;
+UPDATE profiles SET ax_id = 20090168   WHERE pid = 43610;
+UPDATE profiles SET ax_id = 20090169   WHERE pid = 43611;
+UPDATE profiles SET ax_id = 20090451   WHERE pid = 43612;
+UPDATE profiles SET ax_id = 20090170   WHERE pid = 43613;
+UPDATE profiles SET ax_id = 20090171   WHERE pid = 43614;
+UPDATE profiles SET ax_id = 20090172   WHERE pid = 43615;
+UPDATE profiles SET ax_id = 20090173   WHERE pid = 43616;
+UPDATE profiles SET ax_id = 20090174   WHERE pid = 43617;
+UPDATE profiles SET ax_id = 20090175   WHERE pid = 43618;
+UPDATE profiles SET ax_id = 20090176   WHERE pid = 43619;
+UPDATE profiles SET ax_id = 20090177   WHERE pid = 43620;
+UPDATE profiles SET ax_id = 20090452   WHERE pid = 43621;
+UPDATE profiles SET ax_id = 20090178   WHERE pid = 43622;
+UPDATE profiles SET ax_id = 20090179   WHERE pid = 43623;
+UPDATE profiles SET ax_id = 20090180   WHERE pid = 43624;
+UPDATE profiles SET ax_id = 20090181   WHERE pid = 43625;
+UPDATE profiles SET ax_id = 20090182   WHERE pid = 43626;
+UPDATE profiles SET ax_id = 20090183   WHERE pid = 43627;
+UPDATE profiles SET ax_id = 20090185   WHERE pid = 43629;
+UPDATE profiles SET ax_id = 20090186   WHERE pid = 43630;
+UPDATE profiles SET ax_id = 20090187   WHERE pid = 43631;
+UPDATE profiles SET ax_id = 20090188   WHERE pid = 43632;
+UPDATE profiles SET ax_id = 20090189   WHERE pid = 43633;
+UPDATE profiles SET ax_id = 20090190   WHERE pid = 43634;
+UPDATE profiles SET ax_id = 20090191   WHERE pid = 43635;
+UPDATE profiles SET ax_id = 20090192   WHERE pid = 43636;
+UPDATE profiles SET ax_id = 20090453   WHERE pid = 43637;
+UPDATE profiles SET ax_id = 20090454   WHERE pid = 43638;
+UPDATE profiles SET ax_id = 20090455   WHERE pid = 43639;
+UPDATE profiles SET ax_id = 20090193   WHERE pid = 43640;
+UPDATE profiles SET ax_id = 20090194   WHERE pid = 43641;
+UPDATE profiles SET ax_id = 20090195   WHERE pid = 43642;
+UPDATE profiles SET ax_id = 20090196   WHERE pid = 43643;
+UPDATE profiles SET ax_id = 20090197   WHERE pid = 43644;
+UPDATE profiles SET ax_id = 20090198   WHERE pid = 43645;
+UPDATE profiles SET ax_id = 20090199   WHERE pid = 43646;
+UPDATE profiles SET ax_id = 20090201   WHERE pid = 43648;
+UPDATE profiles SET ax_id = 20090456   WHERE pid = 43649;
+UPDATE profiles SET ax_id = 20090202   WHERE pid = 43650;
+UPDATE profiles SET ax_id = 20090203   WHERE pid = 43651;
+UPDATE profiles SET ax_id = 20090204   WHERE pid = 43652;
+UPDATE profiles SET ax_id = 20090205   WHERE pid = 43653;
+UPDATE profiles SET ax_id = 20090206   WHERE pid = 43654;
+UPDATE profiles SET ax_id = 20090457   WHERE pid = 43655;
+UPDATE profiles SET ax_id = 20090207   WHERE pid = 43656;
+UPDATE profiles SET ax_id = 20090208   WHERE pid = 43657;
+UPDATE profiles SET ax_id = 20090209   WHERE pid = 43658;
+UPDATE profiles SET ax_id = 20090210   WHERE pid = 43659;
+UPDATE profiles SET ax_id = 20090212   WHERE pid = 43660;
+UPDATE profiles SET ax_id = 20090211   WHERE pid = 43661;
+UPDATE profiles SET ax_id = 20090213   WHERE pid = 43662;
+UPDATE profiles SET ax_id = 20090214   WHERE pid = 43663;
+UPDATE profiles SET ax_id = 20090458   WHERE pid = 43664;
+UPDATE profiles SET ax_id = 20090215   WHERE pid = 43665;
+UPDATE profiles SET ax_id = 20090216   WHERE pid = 43666;
+UPDATE profiles SET ax_id = 20090217   WHERE pid = 43667;
+UPDATE profiles SET ax_id = 20090459   WHERE pid = 43668;
+UPDATE profiles SET ax_id = 20090218   WHERE pid = 43669;
+UPDATE profiles SET ax_id = 20090219   WHERE pid = 43670;
+UPDATE profiles SET ax_id = 20090220   WHERE pid = 43671;
+UPDATE profiles SET ax_id = 20090222   WHERE pid = 43672;
+UPDATE profiles SET ax_id = 20090221   WHERE pid = 43673;
+UPDATE profiles SET ax_id = 20090223   WHERE pid = 43674;
+UPDATE profiles SET ax_id = 20090224   WHERE pid = 43675;
+UPDATE profiles SET ax_id = 20090225   WHERE pid = 43676;
+UPDATE profiles SET ax_id = 20090226   WHERE pid = 43677;
+UPDATE profiles SET ax_id = 20090227   WHERE pid = 43678;
+UPDATE profiles SET ax_id = 20090460   WHERE pid = 43679;
+UPDATE profiles SET ax_id = 20090228   WHERE pid = 43680;
+UPDATE profiles SET ax_id = 20090230   WHERE pid = 43681;
+UPDATE profiles SET ax_id = 20090229   WHERE pid = 43682;
+UPDATE profiles SET ax_id = 20090461   WHERE pid = 43683;
+UPDATE profiles SET ax_id = 20090462   WHERE pid = 43684;
+UPDATE profiles SET ax_id = 20090231   WHERE pid = 43685;
+UPDATE profiles SET ax_id = 20090232   WHERE pid = 43686;
+UPDATE profiles SET ax_id = 20090463   WHERE pid = 43687;
+UPDATE profiles SET ax_id = 20090233   WHERE pid = 43688;
+UPDATE profiles SET ax_id = 20090234   WHERE pid = 43689;
+UPDATE profiles SET ax_id = 20090235   WHERE pid = 43690;
+UPDATE profiles SET ax_id = 20090236   WHERE pid = 43691;
+UPDATE profiles SET ax_id = 20090464   WHERE pid = 43692;
+UPDATE profiles SET ax_id = 20090465   WHERE pid = 43693;
+UPDATE profiles SET ax_id = 20090237   WHERE pid = 43694;
+UPDATE profiles SET ax_id = 20090466   WHERE pid = 43695;
+UPDATE profiles SET ax_id = 20090238   WHERE pid = 43696;
+UPDATE profiles SET ax_id = 20090239   WHERE pid = 43697;
+UPDATE profiles SET ax_id = 20090467   WHERE pid = 43698;
+UPDATE profiles SET ax_id = 20090468   WHERE pid = 43699;
+UPDATE profiles SET ax_id = 20090240   WHERE pid = 43700;
+UPDATE profiles SET ax_id = 20090241   WHERE pid = 43701;
+UPDATE profiles SET ax_id = 20090243   WHERE pid = 43703;
+UPDATE profiles SET ax_id = 20090469   WHERE pid = 43704;
+UPDATE profiles SET ax_id = 20090244   WHERE pid = 43705;
+UPDATE profiles SET ax_id = 20090470   WHERE pid = 43706;
+UPDATE profiles SET ax_id = 20090246   WHERE pid = 43707;
+UPDATE profiles SET ax_id = 20090245   WHERE pid = 43708;
+UPDATE profiles SET ax_id = 20090247   WHERE pid = 43709;
+UPDATE profiles SET ax_id = 20090248   WHERE pid = 43710;
+UPDATE profiles SET ax_id = 20090249   WHERE pid = 43711;
+UPDATE profiles SET ax_id = 20090250   WHERE pid = 43712;
+UPDATE profiles SET ax_id = 20090472   WHERE pid = 43713;
+UPDATE profiles SET ax_id = 20090471   WHERE pid = 43714;
+UPDATE profiles SET ax_id = 20090251   WHERE pid = 43715;
+UPDATE profiles SET ax_id = 20090252   WHERE pid = 43716;
+UPDATE profiles SET ax_id = 20090254   WHERE pid = 43717;
+UPDATE profiles SET ax_id = 20090255   WHERE pid = 43718;
+UPDATE profiles SET ax_id = 20090256   WHERE pid = 43719;
+UPDATE profiles SET ax_id = 20090259   WHERE pid = 43720;
+UPDATE profiles SET ax_id = 20090260   WHERE pid = 43721;
+UPDATE profiles SET ax_id = 20090261   WHERE pid = 43722;
+UPDATE profiles SET ax_id = 20090262   WHERE pid = 43723;
+UPDATE profiles SET ax_id = 20090257   WHERE pid = 43724;
+UPDATE profiles SET ax_id = 20090263   WHERE pid = 43725;
+UPDATE profiles SET ax_id = 20090264   WHERE pid = 43726;
+UPDATE profiles SET ax_id = 20090265   WHERE pid = 43727;
+UPDATE profiles SET ax_id = 20090266   WHERE pid = 43728;
+UPDATE profiles SET ax_id = 20090267   WHERE pid = 43729;
+UPDATE profiles SET ax_id = 20090473   WHERE pid = 43730;
+UPDATE profiles SET ax_id = 20090258   WHERE pid = 43731;
+UPDATE profiles SET ax_id = 20090270   WHERE pid = 43732;
+UPDATE profiles SET ax_id = 20090269   WHERE pid = 43733;
+UPDATE profiles SET ax_id = 20090268   WHERE pid = 43734;
+UPDATE profiles SET ax_id = 20090271   WHERE pid = 43735;
+UPDATE profiles SET ax_id = 20090475   WHERE pid = 43737;
+UPDATE profiles SET ax_id = 20090273   WHERE pid = 43738;
+UPDATE profiles SET ax_id = 20090474   WHERE pid = 43739;
+UPDATE profiles SET ax_id = 20090476   WHERE pid = 43740;
+UPDATE profiles SET ax_id = 20090274   WHERE pid = 43741;
+UPDATE profiles SET ax_id = 20090275   WHERE pid = 43742;
+UPDATE profiles SET ax_id = 20090477   WHERE pid = 43743;
+UPDATE profiles SET ax_id = 20090276   WHERE pid = 43744;
+UPDATE profiles SET ax_id = 20090277   WHERE pid = 43745;
+UPDATE profiles SET ax_id = 20090278   WHERE pid = 43746;
+UPDATE profiles SET ax_id = 20090279   WHERE pid = 43747;
+UPDATE profiles SET ax_id = 20090280   WHERE pid = 43748;
+UPDATE profiles SET ax_id = 20090282   WHERE pid = 43749;
+UPDATE profiles SET ax_id = 20090283   WHERE pid = 43750;
+UPDATE profiles SET ax_id = 20090285   WHERE pid = 43751;
+UPDATE profiles SET ax_id = 20090284   WHERE pid = 43752;
+UPDATE profiles SET ax_id = 20090286   WHERE pid = 43753;
+UPDATE profiles SET ax_id = 20090287   WHERE pid = 43754;
+UPDATE profiles SET ax_id = 20090288   WHERE pid = 43755;
+UPDATE profiles SET ax_id = 20090289   WHERE pid = 43756;
+UPDATE profiles SET ax_id = 20090290   WHERE pid = 43757;
+UPDATE profiles SET ax_id = 20090478   WHERE pid = 43758;
+UPDATE profiles SET ax_id = 20090291   WHERE pid = 43759;
+UPDATE profiles SET ax_id = 20090479   WHERE pid = 43760;
+UPDATE profiles SET ax_id = 20090293   WHERE pid = 43761;
+UPDATE profiles SET ax_id = 20090480   WHERE pid = 43762;
+UPDATE profiles SET ax_id = 20090294   WHERE pid = 43763;
+UPDATE profiles SET ax_id = 20090481   WHERE pid = 43764;
+UPDATE profiles SET ax_id = 20090295   WHERE pid = 43765;
+UPDATE profiles SET ax_id = 20090296   WHERE pid = 43766;
+UPDATE profiles SET ax_id = 20090482   WHERE pid = 43767;
+UPDATE profiles SET ax_id = 20090298   WHERE pid = 43768;
+UPDATE profiles SET ax_id = 20090299   WHERE pid = 43769;
+UPDATE profiles SET ax_id = 20090300   WHERE pid = 43770;
+UPDATE profiles SET ax_id = 20090483   WHERE pid = 43771;
+UPDATE profiles SET ax_id = 20090301   WHERE pid = 43772;
+UPDATE profiles SET ax_id = 20090302   WHERE pid = 43773;
+UPDATE profiles SET ax_id = 20090484   WHERE pid = 43774;
+UPDATE profiles SET ax_id = 20090303   WHERE pid = 43775;
+UPDATE profiles SET ax_id = 20090304   WHERE pid = 43776;
+UPDATE profiles SET ax_id = 20090305   WHERE pid = 43777;
+UPDATE profiles SET ax_id = 20090306   WHERE pid = 43778;
+UPDATE profiles SET ax_id = 20090307   WHERE pid = 43779;
+UPDATE profiles SET ax_id = 20090485   WHERE pid = 43780;
+UPDATE profiles SET ax_id = 20090308   WHERE pid = 43781;
+UPDATE profiles SET ax_id = 20090309   WHERE pid = 43782;
+UPDATE profiles SET ax_id = 20090310   WHERE pid = 43783;
+UPDATE profiles SET ax_id = 20090311   WHERE pid = 43784;
+UPDATE profiles SET ax_id = 20090313   WHERE pid = 43785;
+UPDATE profiles SET ax_id = 20090314   WHERE pid = 43786;
+UPDATE profiles SET ax_id = 20090315   WHERE pid = 43787;
+UPDATE profiles SET ax_id = 20090316   WHERE pid = 43788;
+UPDATE profiles SET ax_id = 20090317   WHERE pid = 43789;
+UPDATE profiles SET ax_id = 20090318   WHERE pid = 43790;
+UPDATE profiles SET ax_id = 20090319   WHERE pid = 43791;
+UPDATE profiles SET ax_id = 20090320   WHERE pid = 43792;
+UPDATE profiles SET ax_id = 20090486   WHERE pid = 43793;
+UPDATE profiles SET ax_id = 20090487   WHERE pid = 43794;
+UPDATE profiles SET ax_id = 20090321   WHERE pid = 43795;
+UPDATE profiles SET ax_id = 20090322   WHERE pid = 43796;
+UPDATE profiles SET ax_id = 20090323   WHERE pid = 43797;
+UPDATE profiles SET ax_id = 20090324   WHERE pid = 43798;
+UPDATE profiles SET ax_id = 20090325   WHERE pid = 43799;
+UPDATE profiles SET ax_id = 20090326   WHERE pid = 43800;
+UPDATE profiles SET ax_id = 20090327   WHERE pid = 43801;
+UPDATE profiles SET ax_id = 20090328   WHERE pid = 43802;
+UPDATE profiles SET ax_id = 20090329   WHERE pid = 43803;
+UPDATE profiles SET ax_id = 20090330   WHERE pid = 43804;
+UPDATE profiles SET ax_id = 20090331   WHERE pid = 43805;
+UPDATE profiles SET ax_id = 20090332   WHERE pid = 43806;
+UPDATE profiles SET ax_id = 20090333   WHERE pid = 43807;
+UPDATE profiles SET ax_id = 20090334   WHERE pid = 43808;
+UPDATE profiles SET ax_id = 20090335   WHERE pid = 43809;
+UPDATE profiles SET ax_id = 20090336   WHERE pid = 43810;
+UPDATE profiles SET ax_id = 20090337   WHERE pid = 43811;
+UPDATE profiles SET ax_id = 20090338   WHERE pid = 43812;
+UPDATE profiles SET ax_id = 20090339   WHERE pid = 43813;
+UPDATE profiles SET ax_id = 20090340   WHERE pid = 43814;
+UPDATE profiles SET ax_id = 20090341   WHERE pid = 43815;
+UPDATE profiles SET ax_id = 20090342   WHERE pid = 43816;
+UPDATE profiles SET ax_id = 20090343   WHERE pid = 43817;
+UPDATE profiles SET ax_id = 20090488   WHERE pid = 43818;
+UPDATE profiles SET ax_id = 20090344   WHERE pid = 43819;
+UPDATE profiles SET ax_id = 20090345   WHERE pid = 43820;
+UPDATE profiles SET ax_id = 20090346   WHERE pid = 43821;
+UPDATE profiles SET ax_id = 20090347   WHERE pid = 43822;
+UPDATE profiles SET ax_id = 20090348   WHERE pid = 43823;
+UPDATE profiles SET ax_id = 20090349   WHERE pid = 43824;
+UPDATE profiles SET ax_id = 20090350   WHERE pid = 43825;
+UPDATE profiles SET ax_id = 20090351   WHERE pid = 43826;
+UPDATE profiles SET ax_id = 20090352   WHERE pid = 43827;
+UPDATE profiles SET ax_id = 20090353   WHERE pid = 43828;
+UPDATE profiles SET ax_id = 20090354   WHERE pid = 43829;
+UPDATE profiles SET ax_id = 20090489   WHERE pid = 43830;
+UPDATE profiles SET ax_id = 20090491   WHERE pid = 43831;
+UPDATE profiles SET ax_id = 20090490   WHERE pid = 43832;
+UPDATE profiles SET ax_id = 20090355   WHERE pid = 43833;
+UPDATE profiles SET ax_id = 20090356   WHERE pid = 43834;
+UPDATE profiles SET ax_id = 20090357   WHERE pid = 43835;
+UPDATE profiles SET ax_id = 20090358   WHERE pid = 43836;
+UPDATE profiles SET ax_id = 20090359   WHERE pid = 43837;
+UPDATE profiles SET ax_id = 20090360   WHERE pid = 43838;
+UPDATE profiles SET ax_id = 20090361   WHERE pid = 43839;
+UPDATE profiles SET ax_id = 20090362   WHERE pid = 43840;
+UPDATE profiles SET ax_id = 20090363   WHERE pid = 43841;
+UPDATE profiles SET ax_id = 20090364   WHERE pid = 43842;
+UPDATE profiles SET ax_id = 20090365   WHERE pid = 43843;
+UPDATE profiles SET ax_id = 20090366   WHERE pid = 43844;
+UPDATE profiles SET ax_id = 20090367   WHERE pid = 43845;
+UPDATE profiles SET ax_id = 20090368   WHERE pid = 43846;
+UPDATE profiles SET ax_id = 20090369   WHERE pid = 43847;
+UPDATE profiles SET ax_id = 20090371   WHERE pid = 43849;
+UPDATE profiles SET ax_id = 20090372   WHERE pid = 43850;
+UPDATE profiles SET ax_id = 20090373   WHERE pid = 43851;
+UPDATE profiles SET ax_id = 20090374   WHERE pid = 43852;
+UPDATE profiles SET ax_id = 20090375   WHERE pid = 43853;
+UPDATE profiles SET ax_id = 20090376   WHERE pid = 43854;
+UPDATE profiles SET ax_id = 20090377   WHERE pid = 43855;
+UPDATE profiles SET ax_id = 20090378   WHERE pid = 43856;
+UPDATE profiles SET ax_id = 20090379   WHERE pid = 43857;
+UPDATE profiles SET ax_id = 20090380   WHERE pid = 43858;
+UPDATE profiles SET ax_id = 20090381   WHERE pid = 43859;
+UPDATE profiles SET ax_id = 20090382   WHERE pid = 43860;
+UPDATE profiles SET ax_id = 20090383   WHERE pid = 43861;
+UPDATE profiles SET ax_id = 20090384   WHERE pid = 43862;
+UPDATE profiles SET ax_id = 20090385   WHERE pid = 43863;
+UPDATE profiles SET ax_id = 20090387   WHERE pid = 43865;
+UPDATE profiles SET ax_id = 20090388   WHERE pid = 43866;
+UPDATE profiles SET ax_id = 20090492   WHERE pid = 43867;
+UPDATE profiles SET ax_id = 20090389   WHERE pid = 43868;
+UPDATE profiles SET ax_id = 20090390   WHERE pid = 43869;
+UPDATE profiles SET ax_id = 20090391   WHERE pid = 43870;
+UPDATE profiles SET ax_id = 20090392   WHERE pid = 43871;
+UPDATE profiles SET ax_id = 20090393   WHERE pid = 43872;
+UPDATE profiles SET ax_id = 20090394   WHERE pid = 43873;
+UPDATE profiles SET ax_id = 20090395   WHERE pid = 43874;
+UPDATE profiles SET ax_id = 20090396   WHERE pid = 43875;
+UPDATE profiles SET ax_id = 20090397   WHERE pid = 43876;
+UPDATE profiles SET ax_id = 20090494   WHERE pid = 43877;
+UPDATE profiles SET ax_id = 20090495   WHERE pid = 43878;
+UPDATE profiles SET ax_id = 20090493   WHERE pid = 43879;
+UPDATE profiles SET ax_id = 20090398   WHERE pid = 43880;
+UPDATE profiles SET ax_id = 20090399   WHERE pid = 43881;
+UPDATE profiles SET ax_id = 20090400   WHERE pid = 43882;
+UPDATE profiles SET ax_id = 20090401   WHERE pid = 43883;
+UPDATE profiles SET ax_id = 20090403   WHERE pid = 43885;
+UPDATE profiles SET ax_id = 20090496   WHERE pid = 43886;
+UPDATE profiles SET ax_id = 20090404   WHERE pid = 43887;
+UPDATE profiles SET ax_id = 20090405   WHERE pid = 43888;
+UPDATE profiles SET ax_id = 20090406   WHERE pid = 43889;
+UPDATE profiles SET ax_id = 20090407   WHERE pid = 43890;
+UPDATE profiles SET ax_id = 20090408   WHERE pid = 43891;
+UPDATE profiles SET ax_id = 20090409   WHERE pid = 43892;
+UPDATE profiles SET ax_id = 20090497   WHERE pid = 43893;
+UPDATE profiles SET ax_id = 20090410   WHERE pid = 43894;
+UPDATE profiles SET ax_id = 20090411   WHERE pid = 43895;
+UPDATE profiles SET ax_id = 20090412   WHERE pid = 43896;
+UPDATE profiles SET ax_id = 20090498   WHERE pid = 43897;
+UPDATE profiles SET ax_id = 20090413   WHERE pid = 43898;
+UPDATE profiles SET ax_id = 20090414   WHERE pid = 43899;
+UPDATE profiles SET ax_id = 20090415   WHERE pid = 43900;
+UPDATE profiles SET ax_id = 20090416   WHERE pid = 43901;
+UPDATE profiles SET ax_id = 20090417   WHERE pid = 43902;
+UPDATE profiles SET ax_id = 20090419   WHERE pid = 43903;
+UPDATE profiles SET ax_id = 20090420   WHERE pid = 43904;
+UPDATE profiles SET ax_id = 20090421   WHERE pid = 43905;
+UPDATE profiles SET ax_id = 20090499   WHERE pid = 43906;
+UPDATE profiles SET ax_id = 20090500   WHERE pid = 43907;
+UPDATE profiles SET ax_id = 20090503   WHERE pid = 43908;
+UPDATE profiles SET ax_id = 20090422   WHERE pid = 43909;
+UPDATE profiles SET ax_id = 20090502   WHERE pid = 43910;
+UPDATE profiles SET ax_id = 20090501   WHERE pid = 43911;
+UPDATE profiles SET ax_id = 20090423   WHERE pid = 43912;
+UPDATE profiles SET ax_id = 20090504   WHERE pid = 43913;
+UPDATE profiles SET ax_id = 20090424   WHERE pid = 43914;
+UPDATE profiles SET ax_id = 20090425   WHERE pid = 43915;
+UPDATE profiles SET ax_id = 20090505   WHERE pid = 43916;
+UPDATE profiles SET ax_id = 20090426   WHERE pid = 43917;
+UPDATE profiles SET ax_id = 20090506   WHERE pid = 43918;
+UPDATE profiles SET ax_id = 20090507   WHERE pid = 43919;
+UPDATE profiles SET ax_id = 20090427   WHERE pid = 43920;
+UPDATE profiles SET ax_id = 20090428   WHERE pid = 43921;
+UPDATE profiles SET ax_id = 20090429   WHERE pid = 43922;
+UPDATE profiles SET ax_id = 20090430   WHERE pid = 43923;
+UPDATE profiles SET ax_id = 20090508   WHERE pid = 43924;
+UPDATE profiles SET ax_id = 20090431   WHERE pid = 43925;
+UPDATE profiles SET ax_id = 20090509   WHERE pid = 43926;
+UPDATE profiles SET ax_id = 20100001   WHERE pid = 43927;
+UPDATE profiles SET ax_id = 20100002   WHERE pid = 43929;
+UPDATE profiles SET ax_id = 20100003   WHERE pid = 43930;
+UPDATE profiles SET ax_id = 20100004   WHERE pid = 43931;
+UPDATE profiles SET ax_id = 20100005   WHERE pid = 43932;
+UPDATE profiles SET ax_id = 20100006   WHERE pid = 43933;
+UPDATE profiles SET ax_id = 20100007   WHERE pid = 43934;
+UPDATE profiles SET ax_id = 20100008   WHERE pid = 43935;
+UPDATE profiles SET ax_id = 20100009   WHERE pid = 43936;
+UPDATE profiles SET ax_id = 20100010   WHERE pid = 43937;
+UPDATE profiles SET ax_id = 20100011   WHERE pid = 43938;
+UPDATE profiles SET ax_id = 20100012   WHERE pid = 43939;
+UPDATE profiles SET ax_id = 20100014   WHERE pid = 43941;
+UPDATE profiles SET ax_id = 20100015   WHERE pid = 43942;
+UPDATE profiles SET ax_id = 20100016   WHERE pid = 43943;
+UPDATE profiles SET ax_id = 20100017   WHERE pid = 43944;
+UPDATE profiles SET ax_id = 20100018   WHERE pid = 43945;
+UPDATE profiles SET ax_id = 20100019   WHERE pid = 43946;
+UPDATE profiles SET ax_id = 20100020   WHERE pid = 43947;
+UPDATE profiles SET ax_id = 20100021   WHERE pid = 43948;
+UPDATE profiles SET ax_id = 20100022   WHERE pid = 43949;
+UPDATE profiles SET ax_id = 20100023   WHERE pid = 43950;
+UPDATE profiles SET ax_id = 20100026   WHERE pid = 43952;
+UPDATE profiles SET ax_id = 20100027   WHERE pid = 43953;
+UPDATE profiles SET ax_id = 20100028   WHERE pid = 43954;
+UPDATE profiles SET ax_id = 20090292   WHERE pid = 43955;
+UPDATE profiles SET ax_id = 20030496   WHERE pid = 41009;
+UPDATE profiles SET ax_id = 20080005   WHERE pid = 42541;
+UPDATE profiles SET ax_id = 20040330 WHERE pid = 26872;
+UPDATE profiles SET ax_id = 20060005 WHERE pid = 41495;
+UPDATE profiles SET ax_id = 20060006 WHERE pid = 41496;
+UPDATE profiles SET ax_id = 20060016 WHERE pid = 41509;
+UPDATE profiles SET ax_id = 20050496 WHERE pid = 41530;
+UPDATE profiles SET ax_id = 20070454 WHERE pid = 41984;
+UPDATE profiles SET ax_id = 20060431 WHERE pid = 41639;
+UPDATE profiles SET ax_id = 20080020 WHERE pid = 42504;
+UPDATE profiles SET ax_id = 20080006 WHERE pid = 42485;
+UPDATE profiles SET ax_id = 20070507 WHERE pid = 42495;
+UPDATE profiles SET ax_id = 20080004 WHERE pid = 42533;
+UPDATE profiles SET ax_id = 20080012 WHERE pid = 42494;
+UPDATE profiles SET ax_id = 20080002 WHERE pid = 42479;
+UPDATE profiles SET ax_id = 20070522 WHERE pid = 42508;
+UPDATE profiles SET ax_id = 20080008 WHERE pid = 42491;
+UPDATE profiles SET ax_id = 20070539 WHERE pid = 42525;
+UPDATE profiles SET ax_id = 20080009 WHERE pid = 42492;
+UPDATE profiles SET ax_id = 20080028 WHERE pid = 42516;
+UPDATE profiles SET ax_id = 20080013 WHERE pid = 42496;
+UPDATE profiles SET ax_id = 20080001 WHERE pid = 42478;
+UPDATE profiles SET ax_id = 20080003 WHERE pid = 42481;
+UPDATE profiles SET ax_id = 20080018 WHERE pid = 42501;
+UPDATE profiles SET ax_id = 20080023 WHERE pid = 42536;
+UPDATE profiles SET ax_id = 20080022 WHERE pid = 42506;
+UPDATE profiles SET ax_id = 20070115 WHERE pid = 42155;
+UPDATE profiles SET ax_id = 20070537 WHERE pid = 42523;
+UPDATE profiles SET ax_id = 20080024 WHERE pid = 42511;
+UPDATE profiles SET ax_id = 20070523 WHERE pid = 42509;
+UPDATE profiles SET ax_id = 20070385 WHERE pid = 42416;
+UPDATE profiles SET ax_id = 20070526 WHERE pid = 42515;
+UPDATE profiles SET ax_id = 20080030 WHERE pid = 42537;
+UPDATE profiles SET ax_id = 20080490 WHERE pid = 43378;
+UPDATE profiles SET ax_id = 20090002 WHERE pid = 43345;
+UPDATE profiles SET ax_id = 20090013 WHERE pid = 43373;
+UPDATE profiles SET ax_id = 20090029 WHERE pid = 43403;
+UPDATE profiles SET ax_id = 20080273 WHERE pid = 43053;
+UPDATE profiles SET ax_id = 20080267 WHERE pid = 43180;
+UPDATE profiles SET ax_id = 20080274 WHERE pid = 43054;
+UPDATE profiles SET ax_id = 20080495 WHERE pid = 43386;
+UPDATE profiles SET ax_id = 20080494 WHERE pid = 43387;
+UPDATE profiles SET ax_id = 20090026 WHERE pid = 43397;
+UPDATE profiles SET ax_id = 20080291 WHERE pid = 43202;
+UPDATE profiles SET ax_id = 20080096 WHERE pid = 43004;
+UPDATE profiles SET ax_id = 20090001 WHERE pid = 43344;
+UPDATE profiles SET ax_id = 20090017 WHERE pid = 43382;
+UPDATE profiles SET ax_id = 20080483 WHERE pid = 43363;
+UPDATE profiles SET ax_id = 20080478 WHERE pid = 43357;
+UPDATE profiles SET ax_id = 20080479 WHERE pid = 43358;
+UPDATE profiles SET ax_id = 20080467 WHERE pid = 43445;
+UPDATE profiles SET ax_id = 20080466 WHERE pid = 43444;
+UPDATE profiles SET ax_id = 20080428 WHERE pid = 43335;
+UPDATE profiles SET ax_id = 20080496 WHERE pid = 43389;
+UPDATE profiles SET ax_id = 20090370 WHERE pid = 43848;
+UPDATE profiles SET ax_id = 20090242 WHERE pid = 43702;
+UPDATE profiles SET ax_id = 20100013 WHERE pid = 43940;
+UPDATE profiles SET ax_id = 20090093 WHERE pid = 43518;
+UPDATE profiles SET ax_id = 20100025 WHERE pid = 43951;
+UPDATE profiles SET ax_id = 20090184 WHERE pid = 43628;
+UPDATE profiles SET ax_id = 20090402 WHERE pid = 43884;
+UPDATE profiles SET ax_id = 20090272 WHERE pid = 43736;
+UPDATE profiles SET ax_id = 20090158 WHERE pid = 43568;
+UPDATE profiles SET ax_id = 20090386 WHERE pid = 43864;
+UPDATE profiles SET ax_id = 20090200 WHERE pid = 43647;
+UPDATE profiles SET ax_id = 20080501 WHERE pid = 43449;
+UPDATE profiles SET ax_id = 20060023 WHERE pid = 41979;
+UPDATE profiles SET ax_id = 20060030 WHERE pid = 42477;
+
+-- vim:set syntax=mysql:
diff --git a/upgrade/merge-0.0.1/000_1920.sql b/upgrade/merge-0.0.1/000_1920.sql
deleted file mode 100644 (file)
index 0e6a0ed..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-set @n = 19200001;
-
-INSERT INTO  auth_user_md5 (matricule, matricule_ax, promo, promo_sortie, nom_ini, prenom_ini, perms, nom, prenom)
-     SELECT  @n := @n + 1, id_ancien, promotion_etude, promotion_etude + 3, CONCAT(partic_patro, Nom_patronymique), prenom,
-             'pending', CONCAT(partic_patro, Nom_patronymique), prenom
-       FROM  fusionax_anciens
-      WHERE  promotion_etude = 1920;
-
--- vim:set syntax=mysql:
diff --git a/upgrade/merge-0.0.1/00_names.sql b/upgrade/merge-0.0.1/00_names.sql
deleted file mode 100644 (file)
index 1bce81d..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-CREATE OR REPLACE ALGORITHM=MERGE VIEW  fusionax_xorg_anciens AS
-                                SELECT  u.user_id, u.matricule_ax, u.promo,
-                                        n.display AS display_name, n.sort AS sort_name,
-                                        u.nom, u.prenom
-                                  FROM  auth_user_md5         AS u
-                            INNER JOIN  profile_names_display AS n ON (n.user_id = u.user_id);
-
--- vim:set syntax=mysql:
diff --git a/upgrade/merge-0.0.1/04_nationalities.sql b/upgrade/merge-0.0.1/04_nationalities.sql
deleted file mode 100644 (file)
index abacfb6..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-CREATE TEMPORARY TABLE IF NOT EXISTS tmp_update_fusionax_anciens (
-  good CHAR(4) DEFAULT NULL,
-  bad CHAR(4) DEFAULT NULL,
-  PRIMARY KEY(bad),
-  UNIQUE KEY(good)
-) CHARSET=utf8;
-
-INSERT IGNORE INTO  tmp_update_fusionax_anciens (bad, good)
-            VALUES  ('TC', 'CAM'),
-                    ('SH', 'CN'),
-                    ('R', 'RO'),
-                    ('TW', 'RC'),
-                    ('TG', 'RT'),
-                    ('U', 'ROU'),
-                    ('KP', 'ROK'),
-                    ('CRO', 'HR'),
-                    ('UKR', 'UA'),
-                    ('AM', 'ARM'),
-                    ('CS', 'CZ'),
-                    ('SU', 'RUS'),
-                    ('LET', 'LV'),
-                    ('MDA', 'MD');
-
-    UPDATE  fusionax_anciens            AS f
-INNER JOIN  tmp_update_fusionax_anciens AS t ON (f.Code_nationalite = t.bad)
-       SET  f.Code_nationalite = t.good;
-
--- vim:set syntax=mysql:
diff --git a/upgrade/merge-0.0.1/05_check_nationalities.sql b/upgrade/merge-0.0.1/05_check_nationalities.sql
deleted file mode 100644 (file)
index f575425..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
--- Query to check if all the nationalities are now rocognized
--- If the result of this query is not empty, 04_nationalities.sql nedds to be updated
-SELECT DISTINCT  Code_nationalite
-           FROM  fusionax_anciens AS f
-          WHERE  NOT EXISTS (SELECT  *
-                               FROM  geoloc_pays AS g
-                              WHERE  g.license_plate = f.Code_nationalite);
-
-
--- vim:set syntax=mysql: