Subversion Repositories eFlore/Applications.cel

Rev

Rev 2757 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1174 jpm 1
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
2
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
1809 raphael 3
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
1174 jpm 4
 
5
 
6
-- -----------------------------------------------------
7
-- Table `cel_utilisateurs`
8
-- -----------------------------------------------------
2423 jpm 9
CREATE TABLE IF NOT EXISTS `cel_utilisateurs` (
10
  `id_utilisateur` INT NOT NULL,
11
  `prenom` VARCHAR(255) NULL DEFAULT NULL,
12
  `nom` VARCHAR(255) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci' NULL DEFAULT NULL,
13
  `courriel` VARCHAR(255) NOT NULL,
14
  `mot_de_passe` VARCHAR(45) NOT NULL,
15
  `admin` TINYINT(1) NULL DEFAULT '0',
16
  `licence_acceptee` TINYINT(1) NULL DEFAULT '0' COMMENT 'Acceptation de la licence utilisateur pour le cel\n',
17
  `preferences` LONGTEXT NULL DEFAULT NULL COMMENT 'Préférences utilisateur sérialisées sous une forme à définir\n',
18
  `date__premiere_utilisation` DATETIME NOT NULL,
19
  PRIMARY KEY (`id_utilisateur`))
1174 jpm 20
ENGINE = MyISAM
21
DEFAULT CHARACTER SET = utf8
22
COLLATE = utf8_general_ci;
23
 
24
 
25
-- -----------------------------------------------------
2065 aurelien 26
-- Table `cel_arbre_mots_cles_images`
1174 jpm 27
-- -----------------------------------------------------
2423 jpm 28
CREATE TABLE IF NOT EXISTS `cel_arbre_mots_cles_images` (
29
  `id_mot_cle` INT NOT NULL AUTO_INCREMENT,
30
  `chemin` VARCHAR(2048) NULL,
31
  `mot_cle` VARCHAR(80) NULL,
32
  `id_utilisateur` VARCHAR(255) NULL,
33
  PRIMARY KEY (`id_mot_cle`))
2065 aurelien 34
ENGINE = MyISAM;
1174 jpm 35
 
36
 
37
-- -----------------------------------------------------
2065 aurelien 38
-- Table `cel_mots_cles_images_liaison`
1174 jpm 39
-- -----------------------------------------------------
2426 jpm 40
CREATE TABLE IF NOT EXISTS `cel_mots_cles_images_liaison` (
41
  `id_element_lie` INT NOT NULL,
42
  `id_mot_cle` INT NOT NULL,
43
  PRIMARY KEY (`id_element_lie`, `id_mot_cle`),
44
  INDEX `fk_cel_mots_cles_images_liaison_cel_arbre_mots_cles_images1_idx` (`id_mot_cle` ASC))
2065 aurelien 45
ENGINE = MyISAM;
1174 jpm 46
 
47
 
48
-- -----------------------------------------------------
2065 aurelien 49
-- Table `cel_zones_geo`
1174 jpm 50
-- -----------------------------------------------------
2423 jpm 51
CREATE TABLE IF NOT EXISTS `cel_zones_geo` (
52
  `id_zone_geo` VARCHAR(50) NOT NULL,
53
  `code` VARCHAR(10) NOT NULL,
54
  `nom` VARCHAR(255) NOT NULL,
55
  `utm_secteur` CHAR(3) NOT NULL,
56
  `utm_x` INT NOT NULL DEFAULT '0',
57
  `utm_y` INT NOT NULL DEFAULT '0',
58
  `wgs84_latitude` FLOAT NOT NULL,
59
  `wgs84_longitude` FLOAT NOT NULL,
60
  `date_modification` DATETIME NOT NULL,
61
  `ce_zone_geo_parente` VARCHAR(50) NULL DEFAULT NULL,
62
  `bg` BIGINT NULL,
63
  `bd` BIGINT NULL,
64
  `niveau` INT NULL,
65
  PRIMARY KEY (`id_zone_geo`),
66
  INDEX `nom` (`nom` ASC),
67
  INDEX `zone_geo_parente` (`ce_zone_geo_parente` ASC))
2065 aurelien 68
ENGINE = MyISAM
1174 jpm 69
DEFAULT CHARACTER SET = utf8
2065 aurelien 70
COLLATE = utf8_general_ci;
1174 jpm 71
 
72
 
73
-- -----------------------------------------------------
2065 aurelien 74
-- Table `cel_obs_etendues`
1174 jpm 75
-- -----------------------------------------------------
2426 jpm 76
CREATE TABLE IF NOT EXISTS `cel_obs_etendues` (
77
  `id_observation` BIGINT NOT NULL,
78
  `cle` VARCHAR(255) NOT NULL COMMENT 'Clé du champ au format chat mot (sans accents).\nEx. : maCle, uneAutreCle',
79
  `valeur` TEXT NOT NULL COMMENT 'Valeur du champ.',
80
  PRIMARY KEY (`id_observation`, `cle`))
1174 jpm 81
ENGINE = MyISAM
82
DEFAULT CHARACTER SET = utf8
2065 aurelien 83
COLLATE = utf8_general_ci
84
COMMENT = 'Stockage d\'infos supplémentaires sur une observation';
1174 jpm 85
 
86
 
87
-- -----------------------------------------------------
2065 aurelien 88
-- Table `cel_arbre_mots_cles_obs`
1174 jpm 89
-- -----------------------------------------------------
2423 jpm 90
CREATE TABLE IF NOT EXISTS `cel_arbre_mots_cles_obs` (
91
  `id_mot_cle` INT NOT NULL AUTO_INCREMENT,
92
  `chemin` VARCHAR(2048) NULL,
93
  `mot_cle` VARCHAR(80) NULL,
94
  `id_utilisateur` VARCHAR(255) NULL,
95
  PRIMARY KEY (`id_mot_cle`))
2065 aurelien 96
ENGINE = MyISAM;
1174 jpm 97
 
98
 
99
-- -----------------------------------------------------
2065 aurelien 100
-- Table `cel_mots_cles_obs_liaison`
1505 jpm 101
-- -----------------------------------------------------
2426 jpm 102
CREATE TABLE IF NOT EXISTS `cel_mots_cles_obs_liaison` (
103
  `id_element_lie` INT NOT NULL,
104
  `id_mot_cle` INT NOT NULL,
105
  PRIMARY KEY (`id_element_lie`, `id_mot_cle`),
106
  INDEX `fk_cel_mots_cles_obs_liaison_cel_arbre_mots_cles_obs1_idx` (`id_mot_cle` ASC))
2065 aurelien 107
ENGINE = MyISAM;
1505 jpm 108
 
109
 
110
-- -----------------------------------------------------
1174 jpm 111
-- Table `cel_obs`
112
-- -----------------------------------------------------
2423 jpm 113
CREATE TABLE IF NOT EXISTS `cel_obs` (
114
  `id_observation` BIGINT NOT NULL AUTO_INCREMENT,
115
  `ordre` BIGINT NOT NULL,
2474 jpm 116
  `ce_utilisateur` VARCHAR(255) NULL,
2423 jpm 117
  `prenom_utilisateur` VARCHAR(255) NULL DEFAULT NULL,
118
  `nom_utilisateur` VARCHAR(255) NULL DEFAULT NULL,
119
  `courriel_utilisateur` VARCHAR(255) NULL DEFAULT NULL,
120
  `nom_sel` VARCHAR(601) NULL DEFAULT NULL COMMENT 'doit pouvoir contenir CONCAT(bdtfx.nom_sci, \" \", bdtfx.auteur) soit 601 caractères',
121
  `nom_sel_nn` DECIMAL(9,0) NULL DEFAULT NULL COMMENT 'Numéro du nom sélectionné.',
122
  `nom_ret` VARCHAR(601) NULL DEFAULT NULL COMMENT 'doit pouvoir contenir CONCAT(bdtfx.nom_sci, \" \", bdtfx.auteur) soit 601 caractères',
123
  `nom_ret_nn` DECIMAL(9,0) NULL DEFAULT NULL COMMENT 'Numéro du nom retenu = num_nom_retenu dans bdtfx',
124
  `nt` DECIMAL(9,0) NULL DEFAULT NULL COMMENT 'Numéro taxonomique.',
125
  `famille` VARCHAR(255) NULL DEFAULT NULL,
126
  `nom_referentiel` VARCHAR(255) NULL DEFAULT NULL,
2537 aurelien 127
  `pays` VARCHAR(2) NULL DEFAULT NULL COMMENT 'Code de pays suivant le standard ISO 3166-2',
2423 jpm 128
  `ce_zone_geo` VARCHAR(50) NULL DEFAULT NULL,
129
  `zone_geo` VARCHAR(255) NULL DEFAULT NULL,
130
  `lieudit` VARCHAR(255) NULL DEFAULT NULL,
131
  `station` VARCHAR(255) NULL DEFAULT NULL,
132
  `milieu` VARCHAR(255) NULL DEFAULT NULL,
133
  `latitude` DECIMAL(8,5) NULL DEFAULT NULL,
134
  `longitude` DECIMAL(8,5) NULL DEFAULT NULL,
135
  `altitude` INT(5) NULL DEFAULT NULL,
136
  `geodatum` VARCHAR(25) NULL DEFAULT NULL COMMENT 'Référentiel géographique utilisé.\nPar exmple : WGS84',
137
  `date_observation` DATETIME NULL DEFAULT NULL,
138
  `mots_cles_texte` LONGTEXT NULL DEFAULT NULL COMMENT 'Champ calculé contenant la liste des mots clés utilisateurs séparé par des virgules.',
139
  `commentaire` TEXT NULL DEFAULT NULL,
140
  `transmission` TINYINT(1) NULL DEFAULT NULL,
2474 jpm 141
  `date_creation` DATETIME NOT NULL,
142
  `date_modification` DATETIME NOT NULL,
2423 jpm 143
  `date_transmission` DATETIME NULL DEFAULT NULL,
144
  `abondance` VARCHAR(50) NULL DEFAULT NULL,
145
  `certitude` VARCHAR(255) NULL DEFAULT NULL,
146
  `phenologie` VARCHAR(255) NULL DEFAULT NULL,
147
  `code_insee_calcule` VARCHAR(5) NULL DEFAULT NULL COMMENT 'Code INSEE calculé par un scrip CRON.',
148
  PRIMARY KEY (`id_observation`),
149
  INDEX `ce_utilisateur` (`ce_utilisateur`(10) ASC),
150
  INDEX `ce_zone_geo` (`ce_zone_geo` ASC),
2474 jpm 151
  UNIQUE INDEX `id_obs` (`ce_utilisateur` ASC, `courriel_utilisateur` ASC, `ordre` ASC),
152
  INDEX `utilisateur_date_creation` (`ce_utilisateur`(10) ASC, `courriel_utilisateur` ASC, `date_creation` ASC),
2423 jpm 153
  INDEX `coordonnees` (`latitude` ASC, `longitude` ASC),
154
  INDEX `nom_retenu` (`nom_ret` ASC),
155
  INDEX `date_observation` (`date_observation` ASC),
156
  INDEX `nom_referentiel` (`nom_referentiel`(5) ASC)  COMMENT ' /* comment truncated */ /*Index sur (bdtfx,bdtfx,isfan)*/',
157
  INDEX `date_transmission` (`date_transmission` DESC)  COMMENT ' /* comment truncated */ /*Date_transmission : nécessaire à l'ORDER BY utilisé dans la liste d'observation de DEL*/',
158
  INDEX `transmission` (`transmission` ASC)  COMMENT ' /* comment truncated */ /*Nécessaire à CEL/DEL qui officie avec transmission = 1*/')
159
ENGINE = MyISAM
160
DEFAULT CHARACTER SET = utf8
161
COLLATE = utf8_general_ci;
1174 jpm 162
 
2423 jpm 163
 
164
-- -----------------------------------------------------
165
-- Table `cel_images`
166
-- -----------------------------------------------------
167
CREATE TABLE IF NOT EXISTS `cel_images` (
168
  `id_image` BIGINT NOT NULL AUTO_INCREMENT,
169
  `ce_observation` BIGINT NOT NULL,
170
  `ordre` BIGINT NOT NULL,
2474 jpm 171
  `ce_utilisateur` VARCHAR(255) NULL COMMENT 'L\'id utilisateur est un int mais on utilise un varchar pour stocker des observations avec des identifiants temporaires\n',
2423 jpm 172
  `prenom_utilisateur` VARCHAR(255) NULL DEFAULT NULL,
173
  `nom_utilisateur` VARCHAR(255) NULL DEFAULT NULL,
174
  `courriel_utilisateur` VARCHAR(255) NULL DEFAULT NULL,
175
  `hauteur` INT NOT NULL,
176
  `largeur` INT NOT NULL,
177
  `appareil_fabriquant` VARCHAR(50) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci' NULL DEFAULT NULL,
178
  `appareil_modele` VARCHAR(50) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci' NULL DEFAULT NULL,
179
  `date_prise_de_vue` DATETIME NULL DEFAULT NULL,
180
  `note_qualite` DECIMAL(1,0) NULL DEFAULT NULL,
181
  `mots_cles_texte` LONGTEXT NULL DEFAULT NULL COMMENT 'Champ calculé contenant la liste des mots clés utilisateurs séparé par des virgules.\n',
182
  `commentaire` LONGTEXT CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci' NULL DEFAULT NULL,
183
  `nom_original` VARCHAR(255) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci' NULL DEFAULT NULL,
184
  `md5` VARCHAR(32) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci' NULL DEFAULT NULL,
185
  `meta_exif` LONGTEXT CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci' NULL DEFAULT NULL,
186
  `meta_iptc` LONGTEXT CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci' NULL DEFAULT NULL,
187
  `meta_xmp` LONGTEXT NULL DEFAULT NULL,
188
  `meta_makernote` LONGTEXT NULL DEFAULT NULL,
189
  `meta_autres` LONGTEXT NULL DEFAULT NULL,
2493 jpm 190
  `transmission` TINYINT(1) NOT NULL DEFAULT 0,
2423 jpm 191
  `date_creation` DATETIME NOT NULL COMMENT 'Date d\'ajout de l\'image au CEL.',
192
  `date_modification` DATETIME NOT NULL,
193
  `date_liaison` DATETIME NULL DEFAULT NULL,
194
  `date_transmission` DATETIME NULL DEFAULT NULL,
195
  PRIMARY KEY (`id_image`),
2474 jpm 196
  INDEX `id_image` (`ce_utilisateur` ASC, `courriel_utilisateur` ASC, `ordre` ASC),
2423 jpm 197
  INDEX `ce_utilisateur` (`ce_utilisateur` ASC),
198
  INDEX `ce_observation` (`ce_observation` ASC),
199
  INDEX `date_creation` (`date_creation` ASC),
200
  INDEX `date_prise_de_vue` (`date_prise_de_vue` ASC),
2474 jpm 201
  INDEX `utilisateur_date_creation` (`date_creation` ASC, `ce_utilisateur` ASC, `id_image` ASC))
1174 jpm 202
ENGINE = MyISAM
2423 jpm 203
AUTO_INCREMENT = 265
1174 jpm 204
DEFAULT CHARACTER SET = utf8
205
COLLATE = utf8_general_ci;
206
 
1196 jpm 207
 
1197 jpm 208
-- -----------------------------------------------------
209
-- Table `cel_utilisateurs_infos`
210
-- -----------------------------------------------------
2423 jpm 211
CREATE TABLE IF NOT EXISTS `cel_utilisateurs_infos` (
212
  `id_utilisateur` INT NOT NULL,
213
  `admin` TINYINT(1) NOT NULL DEFAULT 0,
214
  `licence_acceptee` TINYINT(1) NOT NULL DEFAULT 0,
215
  `preferences` LONGTEXT NULL DEFAULT NULL,
216
  `date_premiere_utilisation` DATETIME NOT NULL,
217
  PRIMARY KEY (`id_utilisateur`),
218
  INDEX `id_utilisateur` (`id_utilisateur` ASC))
1197 jpm 219
ENGINE = MyISAM
220
DEFAULT CHARACTER SET = utf8
221
COLLATE = utf8_general_ci
1809 raphael 222
COMMENT = 'Contient les infos utilisateurs spécifiques au CEL. À utilis /* comment truncated */ /*er avec une vue pour récupérer les infos de la table annuaire_tela.*/';
1197 jpm 223
 
224
 
225
-- -----------------------------------------------------
1505 jpm 226
-- Table `cel_images_etendues`
227
-- -----------------------------------------------------
2426 jpm 228
CREATE TABLE IF NOT EXISTS `cel_images_etendues` (
229
  `id_observation` BIGINT NOT NULL,
230
  `cle` VARCHAR(255) NOT NULL COMMENT 'Clé du champ au format chat mot (sans accents).\nEx. : maCle, uneAutreCle',
231
  `valeur` TEXT NOT NULL COMMENT 'Valeur du champ.',
232
  PRIMARY KEY (`id_observation`, `cle`),
233
  INDEX `id_observation` (`id_observation` ASC))
1505 jpm 234
ENGINE = MyISAM
235
DEFAULT CHARACTER SET = utf8
236
COLLATE = utf8_general_ci
1881 jpm 237
COMMENT = 'Stockage d\'info supplémentaires sur une image';
1505 jpm 238
 
239
 
240
-- -----------------------------------------------------
2426 jpm 241
-- Table `cel_references`
242
-- -----------------------------------------------------
243
CREATE TABLE IF NOT EXISTS `cel_references` (
244
  `referentiel` INT NOT NULL,
245
  `num_nom` INT NOT NULL,
246
  `num_nom_retenu` INT NULL,
247
  `num_taxon` INT NOT NULL,
248
  `nom_sci` VARCHAR(500) NOT NULL,
249
  `auteur` VARCHAR(100) NULL,
250
  `nom_commun` VARCHAR(60) NULL,
251
  `catminat_code` VARCHAR(18) NULL,
252
  `ve_lumiere` INT(1) NULL,
253
  `ve_temperature` INT(1) NULL,
254
  `ve_continentalite` INT(1) NULL,
255
  `ve_humidite_atmos` INT(1) NULL,
256
  `ve_humidite_edaph` INT(2) NULL,
257
  `ve_reaction_sol` INT(1) NULL,
258
  `ve_nutriments_sol` INT(1) NULL,
259
  `ve_salinite` INT(1) NULL,
260
  `ve_texture_sol` INT(1) NULL,
261
  `ve_mat_org_sol` INT(1) NULL,
262
  `syntaxon` VARCHAR(255) NULL,
263
  PRIMARY KEY (`referentiel`, `num_nom`),
264
  INDEX `referentiel` (`referentiel` ASC),
265
  INDEX `num_nom` (`num_nom` ASC),
266
  INDEX `num_taxon` (`num_taxon` ASC),
267
  INDEX `num_nom_retenu` (`num_nom_retenu` ASC))
268
ENGINE = MyISAM
269
DEFAULT CHARACTER SET = utf8
270
COLLATE = utf8_general_ci;
271
 
272
 
273
-- -----------------------------------------------------
274
-- Table `cel_catalogue_champs_etendus`
275
-- -----------------------------------------------------
276
CREATE TABLE IF NOT EXISTS `cel_catalogue_champs_etendus` (
277
  `cle` VARCHAR(255) NOT NULL,
278
  `label` VARCHAR(255) NULL,
279
  `invisible` TINYINT(1) NOT NULL DEFAULT 0,
280
  `groupe` TINYINT(1) NOT NULL DEFAULT 0,
281
  `prive` TINYINT(1) NOT NULL DEFAULT 0,
282
  PRIMARY KEY (`cle`))
283
ENGINE = InnoDB
284
DEFAULT CHARACTER SET = utf8
285
COLLATE = utf8_general_ci;
286
 
287
 
288
-- -----------------------------------------------------
2395 aurelien 289
-- Table `cel_catalogue_champs_etendus_liaison`
2299 mathias 290
-- -----------------------------------------------------
2426 jpm 291
CREATE TABLE IF NOT EXISTS `cel_catalogue_champs_etendus_liaison` (
292
  `groupe` VARCHAR(255) NOT NULL,
293
  `champ` VARCHAR(255) NOT NULL,
294
  PRIMARY KEY (`groupe`, `champ`),
295
  INDEX `fk_cel_catalogue_champs_etendus_liaison_cel_catalogue_champ_idx` (`champ` ASC))
296
ENGINE = InnoDB
297
DEFAULT CHARACTER SET = utf8
298
COLLATE = utf8_general_ci;
2299 mathias 299
 
2426 jpm 300
 
2299 mathias 301
-- -----------------------------------------------------
1202 jpm 302
-- Placeholder table for view `cel_utilisateurs`
303
-- -----------------------------------------------------
304
CREATE TABLE IF NOT EXISTS `cel_utilisateurs` (`id_utilisateur` INT, `prenom` INT, `nom` INT, `courriel` INT, `mot_de_passe` INT, `licence_acceptee` INT, `admin` INT, `preferences` INT, `date_premiere_utilisation` INT);
305
 
306
-- -----------------------------------------------------
1197 jpm 307
-- Placeholder table for view `cel_tapir`
308
-- -----------------------------------------------------
1505 jpm 309
CREATE TABLE IF NOT EXISTS `cel_tapir` (`guid` INT, `observation_id` INT, `observation_date` INT, `nom_scientifique_complet` INT, `nom_num_nomenclatural` INT, `nom_num_taxonomique` INT, `nom_famille` INT, `lieu_commune_nom_complet` INT, `lieu_commune_nom` INT, `lieu_commune_code_insee` INT, `lieu_commune_source` INT, `lieu_latitude` INT, `lieu_longitude` INT, `lieu_geodatum` INT, `lieu_georeference_source` INT, `lieu_localite` INT, `observateur_prenom` INT, `observateur_nom` INT, `observateur_courriel` INT, `observateur_nom_complet` INT, `observateur_intitule` INT, `observation_commentaire` INT, `observation_information_complement` INT, `saisie_date_modification` INT, `saisie_date_creation` INT);
1197 jpm 310
 
311
-- -----------------------------------------------------
312
-- View `cel_utilisateurs`
313
-- -----------------------------------------------------
314
DROP TABLE IF EXISTS `cel_utilisateurs`;
2240 mathias 315
CREATE  OR REPLACE VIEW `cel_utilisateurs` AS
316
	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,
317
		ui.licence_acceptee, ui.admin, ui.preferences, ui.date_premiere_utilisation
318
	FROM tela_prod_v4.annuaire_tela AS at
1811 raphael 319
		LEFT JOIN cel_utilisateurs_infos AS ui ON (ui.id_utilisateur = at.U_ID);
1197 jpm 320
 
321
-- -----------------------------------------------------
322
-- View `cel_tapir`
323
-- -----------------------------------------------------
324
DROP TABLE IF EXISTS `cel_tapir`;
2240 mathias 325
CREATE  OR REPLACE VIEW `cel_tapir` AS
326
	select concat(_utf8'urn:lsid:tela-botanica.org:cel:',`o`.`id_observation`) AS `guid`,
327
		`o`.`id_observation` AS `observation_id`,
328
		date_format(`o`.`date_observation`,'%Y-%m-%d') AS `observation_date`,
329
		`o`.`nom_sel` AS `nom_scientifique_complet`,
330
		`o`.`nom_sel_nn` AS `nom_num_nomenclatural`,
331
		`o`.`nt` AS `nom_num_taxonomique`,
332
		`o`.`famille` AS `nom_famille`,
333
		concat(_utf8'',`zg`.`nom`,' [INSEE:',`zg`.`code`,']') AS `lieu_commune_nom_complet`,
334
		`zg`.`nom` AS `lieu_commune_nom`,
335
		`zg`.`code` AS `lieu_commune_code_insee`,
336
		if((`zg`.`code` <> ''), 'Lion1906 version 26-05-2008 - http://www.lion1906.com/', NULL) AS `lieu_commune_source`,
337
		format(if((`o`.`latitude` <> ''), `o`.`latitude`, `zg`.`wgs84_latitude`), 5) AS `lieu_latitude`,
338
		format(if((`o`.`longitude` <> ''), `o`.`longitude`, `zg`.`wgs84_longitude`), 5) AS `lieu_longitude`,
339
		`o`.`geodatum` AS `lieu_geodatum`,
340
		if((`o`.`geodatum` <> ''), 'Coordonnées issues de l''utilisation de Google Map', NULL) AS `lieu_georeference_source`,
341
		`o`.`lieudit` AS `lieu_localite`,
342
		`o`.`prenom_utilisateur` AS `observateur_prenom`,
343
		`o`.`nom_utilisateur` AS `observateur_nom`,
344
		`o`.`courriel_utilisateur` AS `observateur_courriel`,
345
		concat(`o`.`prenom_utilisateur`,_utf8' ',`o`.`nom_utilisateur`) AS `observateur_nom_complet`,
346
		concat_ws(' ',`o`.`prenom_utilisateur`,`o`.`nom_utilisateur`,concat('<',`o`.`courriel_utilisateur`,'>')) AS `observateur_intitule`,
347
		`o`.`commentaire` AS `observation_commentaire`,
348
		concat(_utf8'nom_num_nomenclatural=',`o`.`nom_sel_nn`,'; ',
349
			'nom_ret=',encodeToDcsv(`o`.`nom_ret`),'; ',
350
			'nom_num_ret=',`o`.`nom_ret_nn`,'; ',
351
			'nom_num_taxonomique=',`o`.`nt`,'; ',
352
			'nom_referentiel=',encodeToDcsv(`o`.`nom_referentiel`),'; ',
353
			'saisie_date_transmission=',`o`.`date_transmission`,'; ',
354
			'saisie_date_creation=',`o`.`date_creation`,'; ',
355
			'ordre=',`o`.`ordre`,'; ',
356
			'station=',encodeToDcsv(`o`.`station`),'; ',
357
			'milieu=',encodeToDcsv(`o`.`milieu`),'; ',
358
			'mots_cles=',encodeToDcsv(`o`.`mots_cles_texte`),'; ',
359
			'zg_utm_secteur=',encodeToDcsv(`zg`.`utm_secteur`),'; ',
360
			'zg_date_modification=',`zg`.`date_modification`) AS `observation_information_complement`,
361
		`o`.`date_modification` AS `saisie_date_modification`,
362
		`o`.`date_creation` AS `saisie_date_creation`
363
	from (`cel_obs` `o`
364
		left join `cel_zones_geo` `zg` on((`o`.`ce_zone_geo` = `zg`.`id_zone_geo`)))
365
	where `o`.`transmission` = 1
1505 jpm 366
		AND (`o`.`mots_cles_texte` NOT LIKE '%sensible%' OR `o`.`mots_cles_texte` IS NULL);
1197 jpm 367
 
1174 jpm 368
SET SQL_MODE=@OLD_SQL_MODE;
369
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
1196 jpm 370
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
2395 aurelien 371
 
2682 aurelien 372
 
373
--
374
-- Structure de la table `cel_groupes_zones`
375
--
376
 
377
CREATE TABLE IF NOT EXISTS `cel_groupes_zones` (
378
  `id_groupe` varchar(50) NOT NULL,
379
  `valeur` varchar(50) NOT NULL,
380
  KEY `id_groupe` (`id_groupe`),
381
  KEY `valeur` (`valeur`)
382
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
383
 
384
--
385
-- Contenu de la table `cel_groupes_zones`
386
--
387
 
388
INSERT INTO `cel_groupes_zones` (`id_groupe`, `valeur`) VALUES
389
('metropole_grenoble', 'INSEE-C:38057'),
390
('metropole_grenoble', 'INSEE-C:38059'),
391
('metropole_grenoble', 'INSEE-C:38068'),
392
('metropole_grenoble', 'INSEE-C:38071'),
393
('metropole_grenoble', 'INSEE-C:38111'),
394
('metropole_grenoble', 'INSEE-C:38126'),
395
('metropole_grenoble', 'INSEE-C:38150'),
396
('metropole_grenoble', 'INSEE-C:38151'),
397
('metropole_grenoble', 'INSEE-C:38158'),
398
('metropole_grenoble', 'INSEE-C:38169'),
399
('metropole_grenoble', 'INSEE-C:38170'),
400
('metropole_grenoble', 'INSEE-C:38179'),
401
('metropole_grenoble', 'INSEE-C:38185'),
402
('metropole_grenoble', 'INSEE-C:38187'),
403
('metropole_grenoble', 'INSEE-C:38188'),
404
('metropole_grenoble', 'INSEE-C:38200'),
405
('metropole_grenoble', 'INSEE-C:38229'),
406
('metropole_grenoble', 'INSEE-C:38235'),
407
('metropole_grenoble', 'INSEE-C:38252'),
408
('metropole_grenoble', 'INSEE-C:38258'),
409
('metropole_grenoble', 'INSEE-C:38271'),
410
('metropole_grenoble', 'INSEE-C:38277'),
411
('metropole_grenoble', 'INSEE-C:38279'),
412
('metropole_grenoble', 'INSEE-C:38281'),
413
('metropole_grenoble', 'INSEE-C:38309'),
414
('metropole_grenoble', 'INSEE-C:38317'),
415
('metropole_grenoble', 'INSEE-C:38325'),
416
('metropole_grenoble', 'INSEE-C:38328'),
417
('metropole_grenoble', 'INSEE-C:38364'),
418
('metropole_grenoble', 'INSEE-C:38382'),
419
('metropole_grenoble', 'INSEE-C:38388'),
420
('metropole_grenoble', 'INSEE-C:38421'),
421
('metropole_grenoble', 'INSEE-C:38423'),
422
('metropole_grenoble', 'INSEE-C:38436'),
423
('metropole_grenoble', 'INSEE-C:38445'),
424
('metropole_grenoble', 'INSEE-C:38471'),
425
('metropole_grenoble', 'INSEE-C:38472'),
426
('metropole_grenoble', 'INSEE-C:38474'),
427
('metropole_grenoble', 'INSEE-C:38478'),
428
('metropole_grenoble', 'INSEE-C:38485'),
429
('metropole_grenoble', 'INSEE-C:38486'),
430
('metropole_grenoble', 'INSEE-C:38516'),
431
('metropole_grenoble', 'INSEE-C:38524'),
432
('metropole_grenoble', 'INSEE-C:38528'),
433
('metropole_grenoble', 'INSEE-C:38529'),
434
('metropole_grenoble', 'INSEE-C:38533'),
435
('metropole_grenoble', 'INSEE-C:38540'),
436
('metropole_grenoble', 'INSEE-C:38545'),
437
('metropole_grenoble', 'INSEE-C:38562');
438
 
2426 jpm 439
-- -----------------------------------------------------
440
-- Data for table `cel_catalogue_champs_etendus`
441
-- -----------------------------------------------------
442
START TRANSACTION;
443
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('adresse', ' Adresse',  0,  0,  0);
444
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('arbreTetardAligneNbre', ' Nombre d\'arbres d\'alignement',  0,  0,  0);
445
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('arbreTetardCirconferenceA1m', ' Circonférence à 1 m du sol (en m)',  0,  0,  0);
446
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('arbreTetardClasseCirconferenceA1m', ' Classe de circonférence à 1 m du sol (en m)',  0,  0,  0);
447
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('arbreTetardEntretientCoupe', ' Type d\'entretien',  0,  0,  0);
448
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('arbreTetardEtatSanitaire', ' État sanitaire',  0,  0,  0);
449
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('arbreTetardFormation', ' Type de formation',  0,  0,  0);
450
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('arbreTetardHauteurTete', ' Hauteur de la tête (en m)',  0,  0,  0);
451
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('arbreTetardPresenceCavite', ' Présence de cavités',  0,  0,  0);
452
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('arbreTetardPresenceSp', ' Présence d\'espèces sur l\'arbre',  0,  0,  0);
453
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('arbreTetardTailleType', ' Type de taille',  0,  0,  0);
2769 aurelien 454
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('arbres-tetards', ' Champs du projet arbres tétards',  0,  1,  0);
455
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('florileges', ' Champs du projet florilèges',  0,  1,  0);
456
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('sauvages', ' Champs du projet Sauvages de ma rue',  0,  1,  0);
2426 jpm 457
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('coauteurCourriel', ' Courriel du co-auteur',  0,  0,  1);
458
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('coauteurIntitule', ' Intitulé du co-auteur',  0,  0,  0);
459
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('Collecteur', ' Collecteur',  0,  0,  0);
460
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('Collecteurobservation', ' Collecteur de l\'observation',  0,  0,  0);
461
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('coordonneelambert93x', ' coordonneeLambert93X',  0,  0,  0);
462
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('coordonneelambert93y', ' coordonneeLambert93Y',  0,  0,  0);
463
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('dateArretTraitementPhyto', ' Date d\'arrêt des traitements',  0,  0,  0);
464
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('dateDerniereIntervention', ' Dernière intervention',  0,  0,  0);
465
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('Determinateur', ' Déterminateur',  0,  0,  0);
466
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('hauteurBatimentAvoisinant', ' Hauteur des bâtiments',  0,  0,  0);
467
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('hauteurPlante', ' Hauteur max. (en cm) de la plante',  0,  0,  0);
468
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('intensiteGestion', ' Intensité de gestion',  0,  0,  0);
469
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('itineraireGestion', ' Description de l\'itinéraire de gestion',  0,  0,  0);
470
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('latitudeDebutRue', ' Latitude du début de la rue',  0,  0,  0);
471
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('latitudeFinRue', ' Latitude de fin de la rue',  0,  0,  0);
472
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('longitudeDebutRue', ' Longitude du début de la rue',  0,  0,  0);
473
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('longitudeFinRue', ' Longitude de fin de la rue',  0,  0,  0);
474
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('perceptionRiverainMauvaise', ' Mauvaise perception par les riverains ?',  0,  0,  0);
475
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('perceptionTechnicien', ' Perceptions par l\'équipe',  0,  0,  0);
476
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('periodiciteTraitementPhyto', ' Utilisation de produits phytosanitaires',  0,  0,  0);
477
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('personneFonction', ' Fonction de l\'observateur',  0,  0,  0);
478
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('personneService', ' Service de l\'observateur',  0,  0,  0);
479
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('personneStructure', ' Structure de l\'observateur',  0,  0,  0);
480
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('resistanceTraitementPhyto', ' Résistance/Résilience',  0,  0,  0);
481
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('revetementSol', ' Revêtement de sol',  0,  0,  0);
482
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('typoUrbaine', ' Typologie',  0,  0,  0);
483
INSERT INTO `cel_catalogue_champs_etendus` (`cle`, `label`, `invisible`, `groupe`, `prive`) VALUES ('vitesseCroissance', ' Croissance',  0,  0,  0);
2423 jpm 484
 
2426 jpm 485
COMMIT;
486
 
487
 
488
-- -----------------------------------------------------
489
-- Data for table `cel_catalogue_champs_etendus_liaison`
490
-- -----------------------------------------------------
491
START TRANSACTION;
2769 aurelien 492
INSERT INTO `cel_catalogue_champs_etendus_liaison` (`groupe`, `champ`) VALUES
493
('florileges', 'adresse'),
494
('florileges', 'dateArretTraitementPhyto'),
495
('florileges', 'dateDerniereIntervention'),
496
('florileges', 'hauteurBatimentAvoisinant'),
497
('florileges', 'hauteurPlante'),
498
('florileges', 'intensiteGestion'),
499
('florileges', 'itineraireGestion'),
500
('florileges', 'latitudeDebutRue'),
501
('florileges', 'latitudeFinRue'),
502
('florileges', 'longitudeDebutRue'),
503
('florileges', 'longitudeFinRue'),
504
('florileges', 'perceptionRiverainMauvaise'),
505
('florileges', 'perceptionTechnicien'),
506
('florileges', 'periodiciteTraitementPhyto'),
507
('florileges', 'personneFonction'),
508
('florileges', 'personneService'),
509
('florileges', 'personneStructure'),
510
('florileges', 'resistanceTraitementPhyto'),
511
('florileges', 'revetementSol'),
512
('florileges', 'typoUrbaine'),
513
('florileges', 'vitesseCroissance'),
514
('florileges', 'presenceZoneVegetalise'),
515
('sauvages', 'adresse'),
516
('sauvages', 'coteRue'),
517
('sauvages', 'latitudeDebutRue'),
518
('sauvages', 'latitudeFinRue'),
519
('sauvages', 'longitudeDebutRue'),
520
('sauvages', 'longitudeFinRue'),
521
('arbres-tetards', 'coordonneeLambert93X'),
522
('arbres-tetards', 'coordonneeLambert93Y'),
523
('arbres-tetards', 'arbreTetardAligneNbre'),
524
('arbres-tetards', 'arbreTetardClasseCirconferenceA1m'),
525
('arbres-tetards', 'arbreTetardEntretientCoupe'),
526
('arbres-tetards', 'arbreTetardEtatSanitaire'),
527
('arbres-tetards', 'arbreTetardFormation'),
528
('arbres-tetards', 'arbreTetardHauteurTete'),
529
('arbres-tetards', 'arbreTetardPresenceCavite'),
530
('arbres-tetards', 'arbreTetardPresenceSp'),
531
('arbres-tetards', 'arbreTetardTailleType');
2426 jpm 532
 
533
COMMIT;
534