Subversion Repositories eFlore/Applications.del

Rev

Rev 1406 | Rev 1530 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1406 Rev 1418
Line -... Line 1...
-
 
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
-- -----------------------------------------------------
-
 
7
-- Placeholder table for view `del_utilisateurs`
1
-- -----------------------------------------------------
8
-- -----------------------------------------------------
-
 
9
CREATE TABLE IF NOT EXISTS `del_utilisateurs` (`id_utilisateur` INT, `prenom` INT, `nom` INT, `courriel` INT, `mot_de_passe` INT);
-
 
10
 
-
 
11
-- -----------------------------------------------------
-
 
12
-- Placeholder table for view `del_observations`
-
 
13
-- -----------------------------------------------------
-
 
14
CREATE TABLE IF NOT EXISTS `del_observations` (`id_observation` INT, `ce_utilisateur` INT, `prenom_utilisateur` INT, `nom_utilisateur` INT, `courriel_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, `nom_referentiel` INT, `date_observation` INT, `mots_cles_texte` INT, `commentaire` INT, `date_creation` INT, `date_modification` INT, `date_transmission` INT);
-
 
15
 
-
 
16
-- -----------------------------------------------------
-
 
17
-- Placeholder table for view `del_images`
-
 
18
-- -----------------------------------------------------
-
 
19
CREATE TABLE IF NOT EXISTS `del_images` (`id_image` INT, `ce_utilisateur` INT, `prenom_utilisateur` INT, `nom_utilisateur` INT, `courriel_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, `nom_referentiel` INT);
-
 
20
 
-
 
21
-- -----------------------------------------------------
-
 
22
-- Placeholder table for view `del_obs_images`
-
 
23
-- -----------------------------------------------------
-
 
24
CREATE TABLE IF NOT EXISTS `del_obs_images` (`id_image` INT, `id_observation` INT, `date_liaison` INT);
-
 
25
 
-
 
26
-- -----------------------------------------------------
-
 
27
-- Placeholder table for view `v_del_image`
-
 
28
-- -----------------------------------------------------
-
 
29
CREATE TABLE IF NOT EXISTS `v_del_image` (`id_image` INT, `i_ordre` INT, `i_ce_utilisateur` INT, `i_prenom_utilisateur` INT, `i_nom_utilisateur` INT, `i_courriel_utilisateur` INT, `i_mots_cles_texte` INT, `hauteur` INT, `largeur` INT, `date_prise_de_vue` INT, `i_commentaire` INT, `nom_original` INT, `publiable_eflore` INT);
-
 
30
 
-
 
31
-- -----------------------------------------------------
2
-- View `del_utilisateurs`
32
-- View `del_utilisateurs`
3
-- -----------------------------------------------------
33
-- -----------------------------------------------------
4
DROP VIEW IF EXISTS `del_utilisateurs` ;
34
DROP VIEW IF EXISTS `del_utilisateurs` ;
5
DROP TABLE IF EXISTS `del_utilisateurs`;
35
DROP TABLE IF EXISTS `del_utilisateurs`;
6
CREATE  OR REPLACE VIEW del_utilisateur AS 
36
CREATE  OR REPLACE VIEW del_utilisateur AS 
7
	SELECT 
37
	SELECT 
8
    U_ID AS id_utilisateur, 
38
    U_ID AS id_utilisateur, 
9
    CONVERT(U_SURNAME USING UTF8) AS prenom, 
39
    CONVERT(U_SURNAME USING UTF8) AS prenom, 
10
    CONVERT(U_NAME USING UTF8) AS nom, 
40
    CONVERT(U_NAME USING UTF8) AS nom, 
11
    CONVERT(U_MAIL USING UTF8) AS courriel, 
41
    CONVERT(U_MAIL USING UTF8) AS courriel, 
12
    CONVERT(U_PASSWD USING UTF8) AS mot_de_passe 
42
    CONVERT(U_PASSWD USING UTF8) AS mot_de_passe 
13
	FROM tela_prod_v4.annuaire_tela;
43
	FROM tela_prod_v4.annuaire_tela;
14
 
44
 
15
-- -----------------------------------------------------
45
-- -----------------------------------------------------
16
-- View `del_observations`
46
-- View `del_observations`
17
-- -----------------------------------------------------
47
-- -----------------------------------------------------
18
DROP VIEW IF EXISTS `del_observations` ;
48
DROP VIEW IF EXISTS `del_observations` ;
19
DROP TABLE IF EXISTS `del_observations`;
49
DROP TABLE IF EXISTS `del_observations`;
20
CREATE  OR REPLACE VIEW del_observation AS 
50
CREATE  OR REPLACE VIEW del_observation AS 
21
    SELECT id_observation, if((char_length(o.ce_utilisateur) <> 32),cast(o.ce_utilisateur as unsigned),0) AS ce_utilisateur, prenom_utilisateur, nom_utilisateur, courriel_utilisateur, nom_sel, nom_sel_nn, nom_ret, nom_ret_nn, nt, famille, 
51
    SELECT id_observation, if((char_length(o.ce_utilisateur) <> 32),cast(o.ce_utilisateur as unsigned),0) AS ce_utilisateur, prenom_utilisateur, nom_utilisateur, courriel_utilisateur, nom_sel, nom_sel_nn, nom_ret, nom_ret_nn, nt, famille, 
22
        ce_zone_geo, zone_geo, lieudit, station, milieu, nom_referentiel,
52
        ce_zone_geo, zone_geo, lieudit, station, milieu, nom_referentiel, 
23
        date_observation, mots_cles_texte, commentaire, 
53
        date_observation, mots_cles_texte, commentaire, 
24
        date_creation, date_modification, date_transmission 
54
        date_creation, date_modification, date_transmission 
25
    FROM tb_cel.cel_obs AS o
55
    FROM tb_cel.cel_obs AS o
26
    WHERE transmission = '1' ;
56
    WHERE transmission = '1' ;
27
 
57
 
28
-- -----------------------------------------------------
58
-- -----------------------------------------------------
29
-- View `del_images`
59
-- View `del_images`
30
-- -----------------------------------------------------
60
-- -----------------------------------------------------
31
DROP VIEW IF EXISTS `del_images` ;
61
DROP VIEW IF EXISTS `del_images` ;
32
DROP TABLE IF EXISTS `del_images`;
62
DROP TABLE IF EXISTS `del_images`;
33
CREATE  OR REPLACE VIEW del_image AS
63
CREATE  OR REPLACE VIEW del_image AS
34
    SELECT i.id_image, 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, 
64
    SELECT i.id_image, 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, 
35
        i.commentaire, i.nom_original, i.date_modification, i.date_creation, i.publiable_eflore, o.nom_referentiel 
65
        i.commentaire, i.nom_original, i.date_modification, i.date_creation, i.publiable_eflore, o.nom_referentiel
36
    FROM tb_cel.cel_images AS i 
66
    FROM tb_cel.cel_images AS i 
37
        INNER JOIN tb_cel.cel_obs_images AS oi ON (i.id_image = oi.id_image)  
67
        INNER JOIN tb_cel.cel_obs_images AS oi ON (i.id_image = oi.id_image)  
38
        INNER JOIN tb_cel.cel_obs AS o ON (oi.id_observation = o.id_observation)
68
        INNER JOIN tb_cel.cel_obs AS o ON (oi.id_observation = o.id_observation)
39
    WHERE o.transmission = '1' ;
69
    WHERE o.transmission = '1' ;
40
 
70
 
41
-- -----------------------------------------------------
71
-- -----------------------------------------------------
42
-- View `del_obs_images`
72
-- View `del_obs_images`
43
-- -----------------------------------------------------
73
-- -----------------------------------------------------
44
DROP VIEW IF EXISTS `del_obs_images` ;
74
DROP VIEW IF EXISTS `del_obs_images` ;
45
DROP TABLE IF EXISTS `del_obs_images`;
75
DROP TABLE IF EXISTS `del_obs_images`;
46
CREATE  OR REPLACE VIEW del_obs_image AS 
76
CREATE  OR REPLACE VIEW del_obs_image AS 
47
    SELECT oi.id_image, oi.id_observation, oi.date_liaison
77
    SELECT oi.id_image, oi.id_observation, oi.date_liaison
48
    FROM tb_cel.cel_obs_images AS oi 
78
    FROM tb_cel.cel_obs_images AS oi 
49
        INNER JOIN tb_cel.cel_obs AS o ON (oi.id_observation = o.id_observation)
79
        INNER JOIN tb_cel.cel_obs AS o ON (oi.id_observation = o.id_observation)
50
    WHERE o.transmission = '1' ;
80
    WHERE o.transmission = '1' ;
51
 
81
 
52
-- -----------------------------------------------------
82
-- -----------------------------------------------------
53
-- View `v_del_image`
83
-- View `v_del_image`
54
-- -----------------------------------------------------
84
-- -----------------------------------------------------
55
DROP VIEW IF EXISTS `v_del_image` ;
85
DROP VIEW IF EXISTS `v_del_image` ;
56
DROP TABLE IF EXISTS `v_del_image`;
86
DROP TABLE IF EXISTS `v_del_image`;
57
CREATE OR REPLACE VIEW v_del_image AS
87
CREATE OR REPLACE VIEW v_del_image AS
58
    SELECT o.*, i.id_image, i.ordre AS i_ordre,
88
    SELECT o.*, i.id_image, i.ordre AS i_ordre,
59
           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,
89
           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,
60
           i.mots_cles_texte AS i_mots_cles_texte, hauteur, largeur, date_prise_de_vue, i.commentaire AS i_commentaire, nom_original, publiable_eflore
90
           i.mots_cles_texte AS i_mots_cles_texte, hauteur, largeur, date_prise_de_vue, i.commentaire AS i_commentaire, nom_original, publiable_eflore
61
    FROM tb_cel.cel_obs AS o
91
    FROM tb_cel.cel_obs AS o
62
    INNER JOIN tb_cel.cel_obs_images oi ON oi.id_observation = o.id_observation
92
    INNER JOIN tb_cel.cel_obs_images oi ON oi.id_observation = o.id_observation
63
    INNER JOIN tb_cel.cel_images i ON i.id_image = oi.id_image
93
    INNER JOIN tb_cel.cel_images i ON i.id_image = oi.id_image
64
    WHERE o.transmission = '1';
94
    WHERE o.transmission = '1';
-
 
95
 
-
 
96
 
-
 
97
SET SQL_MODE=@OLD_SQL_MODE;
-
 
98
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
-
 
99
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;