714 |
jpm |
1 |
-- TODO : Voir comment remplacer le test REGEXP par quelque chose de plus simple.
|
712 |
jpm |
2 |
|
731 |
jpm |
3 |
DROP VIEW IF EXISTS del_utilisateur ;
|
|
|
4 |
DROP TABLE IF EXISTS del_utilisateur;
|
714 |
jpm |
5 |
CREATE VIEW del_utilisateur AS
|
|
|
6 |
SELECT id_utilisateur, prenom, nom, courriel, mot_de_passe, licence_acceptee
|
|
|
7 |
FROM tb_cel.cel_utilisateurs;
|
712 |
jpm |
8 |
|
731 |
jpm |
9 |
DROP VIEW IF EXISTS del_observation ;
|
|
|
10 |
DROP TABLE IF EXISTS del_observation;
|
712 |
jpm |
11 |
CREATE VIEW del_observation AS
|
714 |
jpm |
12 |
SELECT id_observation, ce_utilisateur, nom_sel, nom_sel_nn, nom_ret, nom_ret_nn, nt, famille,
|
|
|
13 |
ce_zone_geo, zone_geo, lieudit, station, milieu,
|
|
|
14 |
date_observation, mots_cles_texte, commentaire,
|
|
|
15 |
date_creation, date_modification, date_transmission
|
|
|
16 |
FROM tb_cel.cel_obs
|
|
|
17 |
WHERE transmission = '1'
|
|
|
18 |
AND ce_utilisateur REGEXP '^[[:digit:]]+$';
|
712 |
jpm |
19 |
|
731 |
jpm |
20 |
DROP VIEW IF EXISTS del_obs_images ;
|
|
|
21 |
DROP TABLE IF EXISTS del_obs_images;
|
714 |
jpm |
22 |
CREATE VIEW del_obs_images AS
|
|
|
23 |
SELECT oi.id_image, oi.id_utilisateur, oi.id_observation, oi.date_liaison
|
|
|
24 |
FROM tb_cel.cel_obs_images AS oi
|
|
|
25 |
INNER JOIN tb_cel.cel_obs AS o ON (oi.id_observation = o.id_observation)
|
|
|
26 |
WHERE o.transmission = '1'
|
|
|
27 |
AND oi.id_utilisateur REGEXP '^[[:digit:]]+$';
|
|
|
28 |
|
731 |
jpm |
29 |
DROP VIEW IF EXISTS del_image ;
|
|
|
30 |
DROP TABLE IF EXISTS del_image;
|
714 |
jpm |
31 |
CREATE VIEW del_image AS
|
|
|
32 |
SELECT i.id_image, i.ce_utilisateur, i.hauteur, i.largeur, i.date_prise_de_vue, i.mots_cles_texte,
|
|
|
33 |
i.commentaire, i.nom_original, i.date_modification, i.date_creation, i.publiable_eflore
|
|
|
34 |
FROM tb_cel.cel_images AS i ON (i.id_image = oi.id_image)
|
|
|
35 |
INNER JOIN tb_cel.cel_obs_images AS oi ON (oi.id_observation = o.id_observation)
|
|
|
36 |
INNER JOIN tb_cel.cel_obs AS o
|
|
|
37 |
WHERE o.transmission = '1'
|
|
|
38 |
AND i.id_utilisateur REGEXP '^[[:digit:]]+$';
|