Subversion Repositories eFlore/Applications.del

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
784 jpm 1
-- -----------------------------------------------------
809 jpm 2
-- Placeholder table for view `del_utilisateur`
808 jpm 3
-- -----------------------------------------------------
809 jpm 4
CREATE TABLE IF NOT EXISTS `del_utilisateur` (`id_utilisateur` INT, `prenom` INT, `nom` INT, `courriel` INT, `mot_de_passe` INT);
808 jpm 5
 
6
-- -----------------------------------------------------
809 jpm 7
-- Placeholder table for view `del_observation`
808 jpm 8
-- -----------------------------------------------------
809 jpm 9
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);
808 jpm 10
 
11
-- -----------------------------------------------------
809 jpm 12
-- Placeholder table for view `del_image`
808 jpm 13
-- -----------------------------------------------------
809 jpm 14
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);
808 jpm 15
 
16
-- -----------------------------------------------------
809 jpm 17
-- Placeholder table for view `del_obs_image`
808 jpm 18
-- -----------------------------------------------------
809 jpm 19
CREATE TABLE IF NOT EXISTS `del_obs_image` (`id_image` INT, `id_observation` INT, `date_liaison` INT);
808 jpm 20
 
21
-- -----------------------------------------------------
784 jpm 22
-- View `del_utilisateurs`
23
-- -----------------------------------------------------
809 jpm 24
DROP VIEW IF EXISTS `del_utilisateur` ;
25
DROP TABLE IF EXISTS `del_utilisateur`;
784 jpm 26
DELIMITER $$
733 jpm 27
CREATE  OR REPLACE VIEW del_utilisateur AS
808 jpm 28
	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
735 jpm 29
	FROM tb_cel.cel_utilisateurs_infos AS ui
733 jpm 30
		LEFT JOIN tela_prod_v4.annuaire_tela AS at ON (ui.id_utilisateur = at.U_ID);
784 jpm 31
$$
32
DELIMITER ;
712 jpm 33
 
784 jpm 34
;
712 jpm 35
 
784 jpm 36
-- -----------------------------------------------------
37
-- View `del_observations`
38
-- -----------------------------------------------------
809 jpm 39
DROP VIEW IF EXISTS `del_observation` ;
1031 aurelien 40
DROP TABLE IF EXISTS `del_observation`
41
 
784 jpm 42
DELIMITER $$
43
CREATE  OR REPLACE VIEW del_observation AS
1031 aurelien 44
    SELECT o.id_observation, ce_utilisateur, nom_sel, nom_sel_nn, nom_ret, nom_ret_nn, nt, famille,
784 jpm 45
        ce_zone_geo, zone_geo, lieudit, station, milieu,
46
        date_observation, mots_cles_texte, commentaire,
47
        date_creation, date_modification, date_transmission
48
    FROM tb_cel.cel_obs AS o
49
        INNER JOIN tb_cel.cel_utilisateurs_infos AS u ON (o.ce_utilisateur = u.id_utilisateur)
1031 aurelien 50
	INNER JOIN tb_cel.cel_obs_images AS coi ON o.id_observation = coi.id_observation
1030 aurelien 51
    WHERE transmission = '1'
784 jpm 52
$$
1031 aurelien 53
 
784 jpm 54
DELIMITER ;
714 jpm 55
 
784 jpm 56
;
57
 
58
-- -----------------------------------------------------
59
-- View `del_images`
60
-- -----------------------------------------------------
809 jpm 61
DROP VIEW IF EXISTS `del_image` ;
62
DROP TABLE IF EXISTS `del_image`;
784 jpm 63
DELIMITER $$
64
CREATE  OR REPLACE VIEW del_image AS
65
    SELECT i.id_image, i.ce_utilisateur, i.hauteur, i.largeur, i.date_prise_de_vue, i.mots_cles_texte,
66
        i.commentaire, i.nom_original, i.date_modification, i.date_creation, i.publiable_eflore
67
    FROM tb_cel.cel_images AS i
68
        INNER JOIN tb_cel.cel_obs_images AS oi ON (i.id_image = oi.id_image)
69
        INNER JOIN tb_cel.cel_obs AS o ON (oi.id_observation = o.id_observation)
70
        INNER JOIN tb_cel.cel_utilisateurs_infos AS u ON (i.ce_utilisateur = u.id_utilisateur)
71
    WHERE o.transmission = '1'
72
$$
73
DELIMITER ;
74
 
75
;
76
 
77
-- -----------------------------------------------------
78
-- View `del_obs_images`
79
-- -----------------------------------------------------
809 jpm 80
DROP VIEW IF EXISTS `del_obs_image` ;
81
DROP TABLE IF EXISTS `del_obs_image`;
784 jpm 82
DELIMITER $$
83
CREATE  OR REPLACE VIEW del_obs_image AS
84
    SELECT oi.id_image, oi.id_observation, oi.date_liaison
85
    FROM tb_cel.cel_obs_images AS oi
86
        INNER JOIN tb_cel.cel_obs AS o ON (oi.id_observation = o.id_observation)
87
        INNER JOIN tb_cel.cel_utilisateurs_infos AS u ON (o.ce_utilisateur = u.id_utilisateur)
88
    WHERE o.transmission = '1'
89
$$
90
DELIMITER ;
91
 
92
;