Line -... |
Line 1... |
- |
|
1 |
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
|
- |
|
2 |
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
|
- |
|
3 |
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
|
- |
|
4 |
|
1 |
-- Supprime le champ «publiable_eflore»
|
5 |
-- Supprime le champ «publiable_eflore»
|
2 |
ALTER TABLE `cel_images` DROP `publiable_eflore` ;
|
6 |
ALTER TABLE `cel_images` DROP `publiable_eflore` ;
|
Line 3... |
Line 7... |
3 |
|
7 |
|
4 |
-- Ajoute le champ «transmission» dans «cel_images»
|
8 |
-- Ajoute le champ «transmission» dans «cel_images»
|
Line 13... |
Line 17... |
13 |
-- Ajoute le champ «ce_observation» dans «cel_images»
|
17 |
-- Ajoute le champ «ce_observation» dans «cel_images»
|
14 |
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`;
|
Line 15... |
Line 19... |
15 |
|
19 |
|
16 |
-- 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
|
17 |
UPDATE cel_images, cel_obs_images
|
21 |
UPDATE cel_images, cel_obs_images
|
- |
|
22 |
SET cel_images.ce_observation = cel_obs_images.id_observation,
|
18 |
SET cel_images.ce_observation = cel_obs_images.id_observation, cel_images.date_liaison = cel_obs_images.date_liaison
|
23 |
cel_images.date_liaison = cel_obs_images.date_liaison
|
19 |
WHERE cel_images.id_image = cel_obs_images.id_image
|
24 |
WHERE cel_images.id_image = cel_obs_images.id_image
|
Line 20... |
Line 25... |
20 |
AND cel_obs_images.id_image != '0';
|
25 |
AND cel_obs_images.id_image != '0';
|
21 |
|
26 |
|
Line 22... |
Line 27... |
22 |
-- Ajout index sur ce_observation
|
27 |
-- Ajout index sur ce_observation
|
23 |
CREATE INDEX ce_observation ON cel_images (ce_observation);
|
28 |
CREATE INDEX ce_observation ON cel_images (ce_observation);
|
24 |
|
29 |
|
- |
|
30 |
-- Mise à jour du champ «transmission» de la table «cel_images» à partir des données de «cel_obs»
|
25 |
-- Mise à jour du champ «transmission» de la table cel_images à partir des données de cel_obs
|
31 |
UPDATE cel_images, cel_obs
|
26 |
UPDATE cel_images, cel_obs
|
32 |
SET cel_images.transmission = cel_obs.transmission,
|
Line 27... |
Line 33... |
27 |
SET cel_images.transmission = cel_obs.transmission
|
33 |
cel_images.date_transmission = cel_obs.date_transmission
|
28 |
WHERE cel_images.ce_observation = cel_obs.id_observation
|
- |
|
29 |
AND (cel_images.ce_observation IS NOT NULL OR cel_images.ce_observation != 0);
|
34 |
WHERE cel_images.ce_observation = cel_obs.id_observation
|
- |
|
35 |
AND (cel_images.ce_observation IS NOT NULL OR cel_images.ce_observation != 0);
|
- |
|
36 |
|
- |
|
37 |
-- Suppression de la table cel_obs_image inutile
|
- |
|
38 |
DROP TABLE cel_obs_images;
|
- |
|
39 |
|
- |
|
40 |
-- -----------------------------------------------------
|
30 |
|
41 |
SET SQL_MODE=@OLD_SQL_MODE;
|