2418 |
jpm |
1 |
; Remplace la colonne «publiable_eflore» par «transmission»
|
|
|
2 |
ALTER TABLE `cel_images` CHANGE `publiable_eflore` `transmission` TINYINT(1) NOT NULL DEFAULT '1';
|
|
|
3 |
|
|
|
4 |
; Ajoute le champ «date_liaison» dans «cel_images»
|
|
|
5 |
ALTER TABLE `cel_images` ADD `date_liaison` DATETIME NOT NULL AFTER `date_creation`;
|
|
|
6 |
|
|
|
7 |
; Ajoute le champ «ce_observation» dans «cel_images»
|
|
|
8 |
ALTER TABLE `cel_images` ADD `ce_observation` BIGINT NULL AFTER `id_image`;
|
|
|
9 |
|
|
|
10 |
; Met à jour la table cel_image avec les données de cel_obs_images
|
|
|
11 |
UPDATE cel_images, cel_obs_images
|
|
|
12 |
SET cel_images.ce_observation = cel_obs_images.id_observation, cel_images.date_liaison = cel_obs_images.date_liaison
|
|
|
13 |
WHERE cel_images.id_image = cel_obs_images.id_image
|
|
|
14 |
AND cel_obs_images.id_image != '0';
|
|
|
15 |
|
|
|
16 |
; Ajout index sur ce_observation
|
|
|
17 |
CREATE INDEX ce_observation ON cel_images (ce_observation);
|
|
|
18 |
|
|
|
19 |
; Mise à jour du champ «transmission» de la table cel_images à partir des données de cel_obs
|
|
|
20 |
UPDATE cel_images, cel_obs
|
|
|
21 |
SET cel_images.transmission = cel_obs.transmission
|
|
|
22 |
WHERE cel_images.ce_observation = cel_obs.id_observation
|
|
|
23 |
AND (cel_images.ce_observation IS NOT NULL OR cel_images.ce_observation != 0);
|
|
|
24 |
|
|
|
25 |
; Suppression de la table cel_obs_image inutile
|
|
|
26 |
DROP TABLE cel_obs_images;
|