Subversion Repositories eFlore/Applications.del

Rev

Rev 1031 | Rev 1246 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

-- -----------------------------------------------------
-- Placeholder table for view `del_utilisateur`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `del_utilisateur` (`id_utilisateur` INT, `prenom` INT, `nom` INT, `courriel` INT, `mot_de_passe` INT);

-- -----------------------------------------------------
-- Placeholder table for view `del_observation`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `del_observation` (`id_observation` INT, `ce_utilisateur` INT, `nom_sel` INT, `nom_sel_nn` INT, `nom_ret` INT, `nom_ret_nn` INT, `nt` INT, `famille` INT, `ce_zone_geo` INT, `zone_geo` INT, `lieudit` INT, `station` INT, `milieu` INT, `date_observation` INT, `mots_cles_texte` INT, `commentaire` INT, `date_creation` INT, `date_modification` INT, `date_transmission` INT);

-- -----------------------------------------------------
-- Placeholder table for view `del_image`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `del_image` (`id_image` INT, `ce_utilisateur` INT, `hauteur` INT, `largeur` INT, `date_prise_de_vue` INT, `mots_cles_texte` INT, `commentaire` INT, `nom_original` INT, `date_modification` INT, `date_creation` INT, `publiable_eflore` INT);

-- -----------------------------------------------------
-- Placeholder table for view `del_obs_image`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `del_obs_image` (`id_image` INT, `id_observation` INT, `date_liaison` INT);

-- -----------------------------------------------------
-- View `del_utilisateurs`
-- -----------------------------------------------------
DROP VIEW IF EXISTS `del_utilisateur` ;
DROP TABLE IF EXISTS `del_utilisateur`;
DELIMITER $$
CREATE  OR REPLACE ALGORITHM=MERGE VIEW del_utilisateur AS 
        SELECT at.U_ID AS id_utilisateur, at.U_SURNAME AS prenom, at.U_NAME AS nom, at.U_MAIL AS courriel, at.U_PASSWD AS mot_de_passe 
        FROM tb_cel.cel_utilisateurs_infos AS ui 
                LEFT JOIN tela_prod_v4.annuaire_tela AS at ON (ui.id_utilisateur = at.U_ID);
$$
DELIMITER ;

;

-- -----------------------------------------------------
-- View `del_observations`
-- -----------------------------------------------------
DROP VIEW IF EXISTS `del_observation` ;
DROP TABLE IF EXISTS `del_observation`

DELIMITER $$
CREATE  OR REPLACE ALGORITHM=MERGE VIEW  del_observation AS 
    SELECT o.id_observation, ce_utilisateur, nom_sel, nom_sel_nn, nom_ret, nom_ret_nn, nt, famille, 
        ce_zone_geo, zone_geo, lieudit, station, milieu, 
        date_observation, mots_cles_texte, commentaire, 
        date_creation, date_modification, date_transmission 
    FROM tb_cel.cel_obs AS o
    WHERE transmission = '1'
$$

DELIMITER ;

;

-- -----------------------------------------------------
-- View `del_images`
-- -----------------------------------------------------
DROP VIEW IF EXISTS `del_image` ;
DROP TABLE IF EXISTS `del_image`;
DELIMITER $$
CREATE  OR REPLACE ALGORITHM=MERGE VIEW del_image AS
    SELECT i.id_image, i.ce_utilisateur, i.hauteur, i.largeur, i.date_prise_de_vue, i.mots_cles_texte, 
        i.commentaire, i.nom_original, i.date_modification, i.date_creation, i.publiable_eflore 
    FROM tb_cel.cel_images AS i  
$$
DELIMITER ;

;

-- -----------------------------------------------------
-- View `del_obs_images`
-- -----------------------------------------------------
DROP VIEW IF EXISTS `del_obs_image` ;
DROP TABLE IF EXISTS `del_obs_image`;
DELIMITER $$
CREATE  OR REPLACE ALGORITHM=MERGE VIEW  del_obs_image AS 
    SELECT oi.id_image, oi.id_observation, oi.date_liaison
    FROM tb_cel.cel_obs_images AS oi 
        INNER JOIN tb_cel.cel_obs AS o ON (oi.id_observation = o.id_observation)
    WHERE o.transmission = '1' 
$$
DELIMITER ;

;