Line 16... |
Line 16... |
16 |
|
16 |
|
17 |
-- Ajoute le champ «ce_observation» dans «cel_images»
|
17 |
-- Ajoute le champ «ce_observation» dans «cel_images»
|
Line 18... |
Line 18... |
18 |
ALTER TABLE `cel_images` ADD `ce_observation` BIGINT NULL AFTER `id_image`;
|
18 |
ALTER TABLE `cel_images` ADD `ce_observation` BIGINT NULL AFTER `id_image`;
|
- |
|
19 |
|
19 |
|
20 |
-- Met à jour la table cel_image avec les données de cel_obs_images
|
20 |
-- Met à jour la table cel_image avec les données de cel_obs_images
|
21 |
START TRANSACTION;
|
21 |
UPDATE cel_images, cel_obs_images
|
22 |
UPDATE cel_images, cel_obs_images
|
22 |
SET cel_images.ce_observation = cel_obs_images.id_observation,
|
23 |
SET cel_images.ce_observation = cel_obs_images.id_observation,
|
23 |
cel_images.date_liaison = cel_obs_images.date_liaison
|
24 |
cel_images.date_liaison = cel_obs_images.date_liaison
|
- |
|
25 |
WHERE cel_images.id_image = cel_obs_images.id_image
|
Line 24... |
Line 26... |
24 |
WHERE cel_images.id_image = cel_obs_images.id_image
|
26 |
AND cel_obs_images.id_image != '0';
|
25 |
AND cel_obs_images.id_image != '0';
|
27 |
COMMIT;
|
Line 26... |
Line 28... |
26 |
|
28 |
|
- |
|
29 |
-- Ajout index sur ce_observation
|
27 |
-- Ajout index sur ce_observation
|
30 |
CREATE INDEX ce_observation ON cel_images (ce_observation);
|
28 |
CREATE INDEX ce_observation ON cel_images (ce_observation);
|
31 |
|
29 |
|
32 |
-- Mise à jour du champ «transmission» de la table «cel_images» à partir des données de «cel_obs»
|
30 |
-- Mise à jour du champ «transmission» de la table «cel_images» à partir des données de «cel_obs»
|
33 |
START TRANSACTION;
|
31 |
UPDATE cel_images, cel_obs
|
34 |
UPDATE cel_images, cel_obs
|
- |
|
35 |
SET cel_images.transmission = cel_obs.transmission,
|
Line 32... |
Line 36... |
32 |
SET cel_images.transmission = cel_obs.transmission,
|
36 |
cel_images.date_transmission = cel_obs.date_transmission
|
33 |
cel_images.date_transmission = cel_obs.date_transmission
|
37 |
WHERE cel_images.ce_observation = cel_obs.id_observation
|
Line 34... |
Line 38... |
34 |
WHERE cel_images.ce_observation = cel_obs.id_observation
|
38 |
AND (cel_images.ce_observation IS NOT NULL OR cel_images.ce_observation != 0);
|
35 |
AND (cel_images.ce_observation IS NOT NULL OR cel_images.ce_observation != 0);
|
39 |
COMMIT;
|
36 |
|
40 |
|
37 |
-- Suppression de la table cel_obs_image inutile
|
41 |
-- Suppression de la table cel_obs_image inutile
|
38 |
DROP TABLE cel_obs_images;
|
42 |
RENAME TABLE cel_obs_images TO cel_obs_images_obsolete;
|