Rev 1919 | Blame | Compare with Previous | Last modification | View Log | RSS feed
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
-- -----------------------------------------------------
-- View `del_obs_images`
-- -----------------------------------------------------
DROP VIEW IF EXISTS `del_obs_image` ;
DROP TABLE IF EXISTS `del_obs_image`;
-- View `v_del_image`
-- -----------------------------------------------------
DROP VIEW IF EXISTS `v_del_image` ;
DROP TABLE IF EXISTS `v_del_image`;
-- -----------------------------------------------------
-- View `del_observations`
-- -----------------------------------------------------
DROP VIEW IF EXISTS `del_observation` ;
DROP TABLE IF EXISTS `del_observation`;
CREATE OR REPLACE VIEW del_observation AS
SELECT id_observation,
if((char_length(o.ce_utilisateur) <> 32),cast(o.ce_utilisateur as unsigned),0) AS ce_utilisateur,
o.prenom_utilisateur, o.nom_utilisateur, o.courriel_utilisateur,
nom_sel, nom_sel_nn, nom_ret, nom_ret_nn, nt, famille,
ce_zone_geo, zone_geo, lieudit, station, milieu, nom_referentiel,
date_observation, o.mots_cles_texte, o.commentaire,
o.date_creation, o.date_modification, o.date_transmission, certitude
FROM tb_cel.cel_obs AS o INNER JOIN tb_cel.cel_images AS i ON (o.id_observation = i.ce_observation)
WHERE o.transmission = '1' ;
-- -----------------------------------------------------
-- View `del_images`
-- -----------------------------------------------------
DROP VIEW IF EXISTS `del_image` ;
DROP TABLE IF EXISTS `del_image`;
CREATE OR REPLACE VIEW del_image AS
SELECT i.id_image, i.ce_observation,
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,
i.hauteur, i.largeur, i.date_prise_de_vue, i.mots_cles_texte, i.commentaire, i.nom_original,
i.date_creation, i.date_modification, i.date_liaison, i.date_transmission
FROM tb_cel.cel_images AS i
WHERE i.transmission = '1';
-- -----------------------------------------------------
-- View `del_plantnet`
-- -----------------------------------------------------
## 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...
DROP VIEW IF EXISTS `del_plantnet` ;
DROP TABLE IF EXISTS `del_plantnet`;
CREATE OR REPLACE VIEW del_plantnet AS
SELECT `o`.`id_observation` AS `id_observation`,`o`.`ce_utilisateur` AS `ce_utilisateur`,`o`.`prenom_utilisateur` AS `prenom_utilisateur`,
`o`.`nom_utilisateur` AS `nom_utilisateur`,`o`.`courriel_utilisateur` AS `courriel_utilisateur`,`o`.`nom_sel` AS `nom_sel`,
`o`.`nom_sel_nn` AS `nom_sel_nn`,`o`.`nom_ret` AS `nom_ret`,`o`.`famille` AS `famille`,`o`.`nom_referentiel` AS `nom_referentiel`,
`o`.`zone_geo` AS `zone_geo`,`o`.`latitude` AS `latitude`,`o`.`longitude` AS `longitude`,`o`.`altitude` AS `altitude`,
`o`.`date_observation` AS `date_observation`,`o`.`mots_cles_texte` AS `mots_cles_texte`,`o`.`date_creation` AS `date_creation`,
`o`.`date_modification` AS `date_modification`,`o`.`date_transmission` AS `date_transmission`,`i`.`id_image` AS `id_image`,
`i`.`ce_utilisateur` AS `i_ce_utilisateur`,`i`.`mots_cles_texte` AS `i_mots_cles_texte`,`i`.`nom_original` AS `nom_original`,
`i`.`date_creation` AS `i_date_creation`,`i`.`date_modification` AS `i_date_modification`
FROM (`tb_cel_test`.`cel_obs` `o`
JOIN `tb_cel_test`.`cel_images` `i` ON ((`o`.`id_observation` = `i`.`ce_observation`)))
WHERE (`o`.`transmission` = '1');
-- -----------------------------------------------------
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;