Line 93... |
Line 93... |
93 |
$this->bdd->requeter($requete);
|
93 |
$this->bdd->requeter($requete);
|
94 |
$requete = "INSERT INTO ".$this->bd_new_cel.".`user_custom_field`
|
94 |
$requete = "INSERT INTO ".$this->bd_new_cel.".`user_custom_field`
|
95 |
(name, data_type, default_value, field_id)
|
95 |
(name, data_type, default_value, field_id)
|
96 |
SELECT label, 'text', '', cle
|
96 |
SELECT label, 'text', '', cle
|
97 |
FROM ".$this->bd_cel.".`cel_catalogue_champs_etendus`
|
97 |
FROM ".$this->bd_cel.".`cel_catalogue_champs_etendus`
|
98 |
WHERE `cle` not in (SELECT `champ` FROM `cel_catalogue_champs_etendus_liaison`)";
|
98 |
WHERE `cle` not in (SELECT `champ` FROM ".$this->bd_cel.".`cel_catalogue_champs_etendus_liaison`)";
|
99 |
$this->bdd->requeter($requete);
|
99 |
$this->bdd->requeter($requete);
|
100 |
}
|
100 |
}
|
Line 101... |
Line 101... |
101 |
|
101 |
|
102 |
private function migrerObsEtendusUtilisateur() {
|
102 |
private function migrerObsEtendusUtilisateur() {
|
103 |
$requete = "INSERT INTO ".$this->bd_new_cel.".`user_custom_field_occurrence`
|
103 |
$requete = "INSERT INTO ".$this->bd_new_cel.".`user_custom_field_occurrence`
|
104 |
(`occurrence_id`, `user_custom_field_id`, `value`)
|
104 |
(`occurrence_id`, `user_custom_field_id`, `value`)
|
105 |
SELECT `id_observation`, id, `valeur`
|
105 |
SELECT `id_observation`, id, `valeur`
|
106 |
FROM ".$this->bd_cel.".`cel_obs_etendues`
|
106 |
FROM ".$this->bd_cel.".`cel_obs_etendues`
|
107 |
RIGHT JOIN ".$this->bd_new_cel.".`user_custom_field` ON field_id = cle
|
107 |
RIGHT JOIN ".$this->bd_new_cel.".`user_custom_field` ON field_id = cle
|
108 |
WHERE id_observation in (select id FROM `occurrence`)";
|
108 |
WHERE id_observation in (select id FROM ".$this->bd_new_cel.".`occurrence`)";
|
109 |
$this->bdd->requeter($requete);
|
109 |
$this->bdd->requeter($requete);
|
Line 110... |
Line 110... |
110 |
}
|
110 |
}
|
Line 163... |
Line 163... |
163 |
}
|
163 |
}
|
Line 164... |
Line 164... |
164 |
|
164 |
|
165 |
private function ajouterIdProjet() {
|
165 |
private function ajouterIdProjet() {
|
166 |
$requete = "UPDATE ".$this->bd_new_cel.".`project_settings` SET `project_id` = `id`";
|
166 |
$requete = "UPDATE ".$this->bd_new_cel.".`project_settings` SET `project_id` = `id`";
|
167 |
$this->bdd->requeter($requete);
|
167 |
$this->bdd->requeter($requete);
|
168 |
$requete = "INSERT INTO `tb_project`(`id`, `label`, `is_private`) SELECT `id`, `project`, '0' FROM `project_settings` ";
|
168 |
$requete = "INSERT INTO ".$this->bd_new_cel.".`tb_project`(`id`, `label`, `is_private`) SELECT `id`, `project`, '0' FROM ".$this->bd_new_cel.".`project_settings` ";
|
169 |
$this->bdd->requeter($requete);
|
169 |
$this->bdd->requeter($requete);
|
170 |
$requete = "UPDATE `extended_field` f right join `project_settings` s on
|
170 |
$requete = "UPDATE ".$this->bd_new_cel.".`extended_field` f right join ".$this->bd_new_cel.".`project_settings` s on
|
171 |
s.`project` = f.`project` SET f.`project_id` = s.`project_id`";
|
171 |
s.`project` = f.`project` SET f.`project_id` = s.`project_id`";
|
172 |
$this->bdd->requeter($requete);
|
172 |
$this->bdd->requeter($requete);
|
173 |
$requete = "UPDATE `occurrence` o right join `project_settings` s on
|
173 |
$requete = "UPDATE ".$this->bd_new_cel.".`occurrence` o right join ".$this->bd_new_cel.".`project_settings` s on
|
174 |
s.`project` = o.`project` SET o.`project_id` = s.`project_id`";
|
174 |
s.`project` = o.`project` SET o.`project_id` = s.`project_id`";
|
175 |
$this->bdd->requeter($requete);
|
175 |
$this->bdd->requeter($requete);
|