1418 |
raphael |
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 |
-- Placeholder table for view `del_utilisateurs`
|
|
|
7 |
-- -----------------------------------------------------
|
|
|
8 |
CREATE TABLE IF NOT EXISTS `del_utilisateurs` (`id_utilisateur` INT, `prenom` INT, `nom` INT, `courriel` INT, `mot_de_passe` INT);
|
|
|
9 |
|
|
|
10 |
-- -----------------------------------------------------
|
|
|
11 |
-- Placeholder table for view `del_observations`
|
|
|
12 |
-- -----------------------------------------------------
|
1870 |
jpm |
13 |
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, `certitude` INT);
|
1418 |
raphael |
14 |
|
|
|
15 |
-- -----------------------------------------------------
|
|
|
16 |
-- Placeholder table for view `del_images`
|
|
|
17 |
-- -----------------------------------------------------
|
1870 |
jpm |
18 |
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_creation` INT, `date_modification` INT, `date_liaison` INT, `date_transmission` INT);
|
1418 |
raphael |
19 |
|
|
|
20 |
-- -----------------------------------------------------
|
|
|
21 |
-- View `del_utilisateurs`
|
|
|
22 |
-- -----------------------------------------------------
|
|
|
23 |
DROP VIEW IF EXISTS `del_utilisateurs` ;
|
|
|
24 |
DROP TABLE IF EXISTS `del_utilisateurs`;
|
1530 |
mathias |
25 |
CREATE OR REPLACE VIEW del_utilisateur AS
|
|
|
26 |
SELECT
|
|
|
27 |
U_ID AS id_utilisateur,
|
|
|
28 |
CONVERT(U_SURNAME USING UTF8) AS prenom,
|
|
|
29 |
CONVERT(U_NAME USING UTF8) AS nom,
|
|
|
30 |
CONVERT(U_MAIL USING UTF8) AS courriel,
|
|
|
31 |
CONVERT(U_PASSWD USING UTF8) AS mot_de_passe
|
1418 |
raphael |
32 |
FROM tela_prod_v4.annuaire_tela;
|
|
|
33 |
|
|
|
34 |
-- -----------------------------------------------------
|
|
|
35 |
-- View `del_observations`
|
|
|
36 |
-- -----------------------------------------------------
|
|
|
37 |
DROP VIEW IF EXISTS `del_observations` ;
|
|
|
38 |
DROP TABLE IF EXISTS `del_observations`;
|
1530 |
mathias |
39 |
CREATE OR REPLACE VIEW del_observation AS
|
1979 |
aurelien |
40 |
SELECT id_observation,
|
|
|
41 |
if((char_length(o.ce_utilisateur) <> 32),cast(o.ce_utilisateur as unsigned),0) AS ce_utilisateur,
|
|
|
42 |
o.prenom_utilisateur, o.nom_utilisateur, o.courriel_utilisateur,
|
|
|
43 |
nom_sel, nom_sel_nn, nom_ret, nom_ret_nn, nt, famille,
|
1530 |
mathias |
44 |
ce_zone_geo, zone_geo, lieudit, station, milieu, nom_referentiel,
|
1979 |
aurelien |
45 |
date_observation, o.mots_cles_texte, o.commentaire,
|
1987 |
aurelien |
46 |
o.date_creation, o.date_modification, o.date_transmission, certitude, pays
|
1979 |
aurelien |
47 |
FROM tb_cel.cel_obs AS o WHERE o.id_observation IN (SELECT i.ce_observation FROM tb_cel.cel_images i)
|
|
|
48 |
AND o.transmission = '1' ;
|
1418 |
raphael |
49 |
|
|
|
50 |
-- -----------------------------------------------------
|
|
|
51 |
-- View `del_images`
|
|
|
52 |
-- -----------------------------------------------------
|
|
|
53 |
DROP VIEW IF EXISTS `del_images` ;
|
|
|
54 |
DROP TABLE IF EXISTS `del_images`;
|
1530 |
mathias |
55 |
CREATE OR REPLACE VIEW del_image AS
|
1870 |
jpm |
56 |
SELECT i.id_image,
|
|
|
57 |
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,
|
|
|
58 |
i.hauteur, i.largeur, i.date_prise_de_vue, i.mots_cles_texte, i.commentaire, i.nom_original,
|
|
|
59 |
i.date_creation, i.date_modification, i.date_liaison, i.date_transmission
|
|
|
60 |
FROM cel_images AS i
|
|
|
61 |
WHERE i.transmission = '1';
|
1418 |
raphael |
62 |
|
|
|
63 |
SET SQL_MODE=@OLD_SQL_MODE;
|
|
|
64 |
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
|
1979 |
aurelien |
65 |
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
|