1870 |
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 |
|
|
|
5 |
-- -----------------------------------------------------
|
|
|
6 |
-- View `del_obs_images`
|
|
|
7 |
-- -----------------------------------------------------
|
1919 |
jpm |
8 |
DROP VIEW IF EXISTS `del_obs_image` ;
|
|
|
9 |
DROP TABLE IF EXISTS `del_obs_image`;
|
1870 |
jpm |
10 |
|
1880 |
jpm |
11 |
-- View `v_del_image`
|
|
|
12 |
-- -----------------------------------------------------
|
|
|
13 |
DROP VIEW IF EXISTS `v_del_image` ;
|
|
|
14 |
DROP TABLE IF EXISTS `v_del_image`;
|
1870 |
jpm |
15 |
|
|
|
16 |
-- -----------------------------------------------------
|
|
|
17 |
-- View `del_observations`
|
|
|
18 |
-- -----------------------------------------------------
|
|
|
19 |
DROP VIEW IF EXISTS `del_observation` ;
|
|
|
20 |
DROP TABLE IF EXISTS `del_observation`;
|
|
|
21 |
CREATE OR REPLACE VIEW del_observation AS
|
|
|
22 |
SELECT id_observation,
|
|
|
23 |
if((char_length(o.ce_utilisateur) <> 32),cast(o.ce_utilisateur as unsigned),0) AS ce_utilisateur,
|
|
|
24 |
o.prenom_utilisateur, o.nom_utilisateur, o.courriel_utilisateur,
|
|
|
25 |
nom_sel, nom_sel_nn, nom_ret, nom_ret_nn, nt, famille,
|
|
|
26 |
ce_zone_geo, zone_geo, lieudit, station, milieu, nom_referentiel,
|
|
|
27 |
date_observation, o.mots_cles_texte, o.commentaire,
|
|
|
28 |
o.date_creation, o.date_modification, o.date_transmission, certitude
|
|
|
29 |
FROM tb_cel.cel_obs AS o INNER JOIN tb_cel.cel_images AS i ON (o.id_observation = i.ce_observation)
|
|
|
30 |
WHERE o.transmission = '1' ;
|
|
|
31 |
|
|
|
32 |
-- -----------------------------------------------------
|
|
|
33 |
-- View `del_images`
|
|
|
34 |
-- -----------------------------------------------------
|
|
|
35 |
DROP VIEW IF EXISTS `del_image` ;
|
|
|
36 |
DROP TABLE IF EXISTS `del_image`;
|
|
|
37 |
CREATE OR REPLACE VIEW del_image AS
|
|
|
38 |
SELECT i.id_image, i.ce_observation,
|
|
|
39 |
if((char_length(i.ce_utilisateur) <> 32),cast(i.ce_utilisateur as unsigned),0) AS ce_utilisateur, i.prenom_utilisateur, i.nom_utilisateur, i.courriel_utilisateur,
|
|
|
40 |
i.hauteur, i.largeur, i.date_prise_de_vue, i.mots_cles_texte, i.commentaire, i.nom_original,
|
|
|
41 |
i.date_creation, i.date_modification, i.date_liaison, i.date_transmission
|
|
|
42 |
FROM tb_cel.cel_images AS i
|
|
|
43 |
WHERE i.transmission = '1';
|
|
|
44 |
|
|
|
45 |
-- -----------------------------------------------------
|
1880 |
jpm |
46 |
-- View `del_plantnet`
|
1870 |
jpm |
47 |
-- -----------------------------------------------------
|
1880 |
jpm |
48 |
## Il est nécessaire de garder une vue de ce type car l'optimisateur d'index de MYSQL fait n'importe quoi dans le cas du WS plantnet/changements...
|
|
|
49 |
DROP VIEW IF EXISTS `del_plantnet` ;
|
|
|
50 |
DROP TABLE IF EXISTS `del_plantnet`;
|
|
|
51 |
CREATE OR REPLACE VIEW del_plantnet AS
|
|
|
52 |
SELECT o.*,
|
|
|
53 |
i.id_image,
|
|
|
54 |
i.ce_utilisateur AS i_ce_utilisateur, i.prenom_utilisateur AS i_prenom_utilisateur, i.nom_utilisateur AS i_nom_utilisateur, i.courriel_utilisateur AS i_courriel_utilisateur,
|
|
|
55 |
hauteur, largeur, i.date_prise_de_vue, i.mots_cles_texte AS i_mots_cles_texte, i.commentaire AS i_commentaire, i.nom_original,
|
|
|
56 |
i.date_creation AS i_date_creation, i.date_modification AS i_date_modification, i.date_liaison AS i_date_liaison, i.date_transmission AS i_date_transmission
|
|
|
57 |
FROM tb_cel.cel_obs AS o
|
|
|
58 |
INNER JOIN tb_cel.cel_images AS i ON (o.id_observation = i.ce_observation )
|
|
|
59 |
WHERE o.transmission = '1';
|
1870 |
jpm |
60 |
|
|
|
61 |
-- -----------------------------------------------------
|
|
|
62 |
SET SQL_MODE=@OLD_SQL_MODE;
|
|
|
63 |
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
|
|
|
64 |
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
|