Subversion Repositories eFlore/Applications.del

Rev

Rev 1870 | Rev 1880 | Go to most recent revision | 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_images` ;
DROP TABLE IF EXISTS `del_obs_images`;


-- -----------------------------------------------------
-- 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 `v_del_image`
-- -----------------------------------------------------
DROP VIEW IF EXISTS `v_del_image` ;
DROP TABLE IF EXISTS `v_del_image`;

-- -----------------------------------------------------
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;