2428 |
jpm |
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 |
|
2467 |
jpm |
5 |
SET GLOBAL SQL_MODE = 'NO_ENGINE_SUBSTITUTION,ALLOW_INVALID_DATES';
|
|
|
6 |
|
2427 |
jpm |
7 |
-- Supprime le champ «publiable_eflore»
|
|
|
8 |
ALTER TABLE `cel_images` DROP `publiable_eflore` ;
|
2418 |
jpm |
9 |
|
2427 |
jpm |
10 |
-- Ajoute le champ «transmission» dans «cel_images»
|
|
|
11 |
ALTER TABLE `cel_images` ADD `transmission` TINYINT(1) NOT NULL DEFAULT '1' AFTER `meta_autres`;
|
|
|
12 |
|
|
|
13 |
-- Ajoute le champ «date_liaison» dans «cel_images»
|
2418 |
jpm |
14 |
ALTER TABLE `cel_images` ADD `date_liaison` DATETIME NOT NULL AFTER `date_creation`;
|
|
|
15 |
|
2427 |
jpm |
16 |
-- Ajoute le champ «date_transmission» dans «cel_images»
|
2466 |
aurelien |
17 |
ALTER TABLE `cel_images` ADD `date_transmission` DATETIME NULL AFTER `date_liaison`;
|
2427 |
jpm |
18 |
|
|
|
19 |
-- Ajoute le champ «ce_observation» dans «cel_images»
|
2418 |
jpm |
20 |
ALTER TABLE `cel_images` ADD `ce_observation` BIGINT NULL AFTER `id_image`;
|
|
|
21 |
|
2427 |
jpm |
22 |
-- Met à jour la table cel_image avec les données de cel_obs_images
|
2435 |
jpm |
23 |
START TRANSACTION;
|
2418 |
jpm |
24 |
UPDATE cel_images, cel_obs_images
|
2428 |
jpm |
25 |
SET cel_images.ce_observation = cel_obs_images.id_observation,
|
|
|
26 |
cel_images.date_liaison = cel_obs_images.date_liaison
|
2418 |
jpm |
27 |
WHERE cel_images.id_image = cel_obs_images.id_image
|
|
|
28 |
AND cel_obs_images.id_image != '0';
|
2435 |
jpm |
29 |
COMMIT;
|
2418 |
jpm |
30 |
|
2427 |
jpm |
31 |
-- Ajout index sur ce_observation
|
2418 |
jpm |
32 |
CREATE INDEX ce_observation ON cel_images (ce_observation);
|
|
|
33 |
|
2428 |
jpm |
34 |
-- Mise à jour du champ «transmission» de la table «cel_images» à partir des données de «cel_obs»
|
2435 |
jpm |
35 |
START TRANSACTION;
|
2418 |
jpm |
36 |
UPDATE cel_images, cel_obs
|
2428 |
jpm |
37 |
SET cel_images.transmission = cel_obs.transmission,
|
|
|
38 |
cel_images.date_transmission = cel_obs.date_transmission
|
2418 |
jpm |
39 |
WHERE cel_images.ce_observation = cel_obs.id_observation
|
|
|
40 |
AND (cel_images.ce_observation IS NOT NULL OR cel_images.ce_observation != 0);
|
2435 |
jpm |
41 |
COMMIT;
|
2418 |
jpm |
42 |
|
2427 |
jpm |
43 |
-- Suppression de la table cel_obs_image inutile
|
2435 |
jpm |
44 |
RENAME TABLE cel_obs_images TO cel_obs_images_obsolete;
|
2428 |
jpm |
45 |
|
|
|
46 |
-- -----------------------------------------------------
|
|
|
47 |
SET SQL_MODE=@OLD_SQL_MODE;
|
|
|
48 |
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
|
2466 |
aurelien |
49 |
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
|