Subversion Repositories eFlore/Applications.cel

Rev

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

Rev Author Line No. Line
3458 delphine 1
SET foreign_key_checks = 0;
2
DROP TABLE IF EXISTS `change_log`;
3
CREATE TABLE `change_log` (
4
  `id` int(11) NOT NULL AUTO_INCREMENT,
5
  `entity_id` int(11) DEFAULT NULL COMMENT 'ID de l''entité',
6
  `action_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Action sur l''entité à répercuter dans l''index',
7
  `entity_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Nom de l''entité sur laquelle porte l''action à répercuter.',
8
  PRIMARY KEY (`id`)
9
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
10
 
11
--
12
-- Table structure for table `tb_project`
13
--
14
 
15
DROP TABLE IF EXISTS `tb_project`;
16
CREATE TABLE `tb_project` (
17
  `id` int(11) NOT NULL AUTO_INCREMENT,
18
  `parent_id` int(11) DEFAULT NULL,
19
  `label` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Intitulé du projet',
20
  `is_private` tinyint(1) NOT NULL COMMENT 'Indique si tout le monde peut contribuer au projet (''false'') ou seulement les admin (''true'')',
21
  PRIMARY KEY (`id`),
22
  UNIQUE KEY `UNIQ_50640A4C727ACA70` (`parent_id`)
23
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
24
 
25
 
26
--
27
-- Table structure for table `project_settings`
28
--
29
 
30
DROP TABLE IF EXISTS `project_settings`;
31
CREATE TABLE `project_settings` (
32
  `id` int(11) NOT NULL AUTO_INCREMENT,
33
  `project_id` int(11) DEFAULT NULL,
34
  `project` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL,
35
  `language` varchar(2) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Langue du projet',
36
  `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Titre du wigdet à afficher',
37
  `logo` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Logo du projet',
38
  `description` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
39
  `type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
40
  `is_type` tinyint(1) DEFAULT NULL,
41
  `css_style` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
42
  `image_font` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
43
  `date_created` datetime NOT NULL COMMENT 'Date de création du widget',
44
  `date_updated` datetime DEFAULT NULL COMMENT 'Date de dernière modif du widget',
45
  `taxo_restriction_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Niveau de restriction pour la saisie du taxon : un seul taxon sélectionnable, plusieurs, un référentiel',
46
  `taxo_restriction_value` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Liste de valeurs possibles pour le taxon. Prend la forme ''repository_name: taxoId1,taxoId2, ...,taxoIdn''',
47
  `location_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT ' Le type de zone géographique concernée par le projet',
48
  `location` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
49
  `environment` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Valeur(s) par défaut du champ ''environment'' (milieux) de toutes les obs du projet',
50
  `published_location` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Précision géographique à laquelle est publiée l''obs, permet de gérer le floutage(DC2Type:publishedlocationenum)',
51
  `project_tag_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Un tag par défaut est associé à toutes les obs du projet',
52
  `info` varchar(15) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Type mime de l''image décrivant le projet',
53
  PRIMARY KEY (`id`),
54
  UNIQUE KEY `id_project_lang` (`project`,`language`),
55
  KEY `IDX_D80B2B1E166D1F9C` (`project_id`)
56
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Info pour configurer le widget de saisie - la clé primaire est le nom du projet + la langue';
57
 
58
 
59
--
60
-- Table structure for table `user_profile_cel`
61
--
62
 
63
DROP TABLE IF EXISTS `user_profile_cel`;
64
CREATE TABLE `user_profile_cel` (
65
  `id` int(11) NOT NULL,
66
  `administered_project_id` int(11) DEFAULT NULL,
67
  `anonymize_data` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Anonymisation des données d''observation',
68
  `is_end_user_licence_accepted` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Validation des conditions d''utilisation',
69
  `always_display_advanced_fields` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Validation des conditions d''utilisation',
70
  `language` enum('EN','FR') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'FR' COMMENT 'langage choisi pour communiquer dans l''interface.(DC2Type:languageenum)',
71
  PRIMARY KEY (`id`),
72
  KEY `IDX_EEE77E506C1DD863` (`administered_project_id`)
73
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Gestion des préférences utilisateurs';
74
 
75
 
76
--
77
-- Table structure for table `del_update_notfications`
78
--
79
 
80
DROP TABLE IF EXISTS `del_update_notfications`;
81
CREATE TABLE `del_update_notfications` (
82
  `id` int(11) NOT NULL AUTO_INCREMENT,
83
  `occurrence_id` int(11) DEFAULT NULL,
84
  `identiplante_score` int(11) DEFAULT NULL COMMENT 'Nouveau score de l''observation sur identiplante',
85
  `is_identiplante_validated` tinyint(1) NOT NULL COMMENT 'Statut validé (ou non) de l''observation sur identiplante',
86
  `date_updated` datetime DEFAULT NULL COMMENT 'Date de dernière modification',
87
  PRIMARY KEY (`id`),
88
  KEY `IDX_6C07859630572FAC` (`occurrence_id`)
89
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
90
 
91
 
92
--
93
-- Table structure for table `occurrence`
94
--
95
 
96
DROP TABLE IF EXISTS `occurrence`;
97
CREATE TABLE `occurrence` (
98
  `id` int(11) NOT NULL AUTO_INCREMENT,
99
  `project_id` int(11) DEFAULT NULL,
100
  `user_id` int(11) DEFAULT NULL COMMENT 'id de l''utilisateur ayant saisi l''obs (seulement identification de tela, si utilisateur non inscrit ce champ est vide)',
101
  `user_email` varchar(155) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Email de l''utilisateur ayant saisi l''obs',
102
  `user_pseudo` varchar(155) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Pseudo de l''utilisateur ayant saisi l''obs. Nom/Prénom si non renseigné.',
103
  `observer` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Observateur',
104
  `observer_institution` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Structure dans le cadre de laquelle l''obs a été faite',
105
  `date_observed` datetime DEFAULT NULL COMMENT 'Date d''observation',
106
  `date_created` datetime NOT NULL COMMENT 'Date de création de l''obs',
107
  `date_updated` datetime DEFAULT NULL COMMENT 'Date de la dernière modification de l''obs',
108
  `date_published` datetime DEFAULT NULL COMMENT 'Date de publication de l''obs = transmission au réseau',
109
  `user_sci_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Nom saisi par l''utilisateur (nom scientifique ou autre terme qualifiant  l''individu observé)',
110
  `user_sci_name_id` int(11) DEFAULT NULL COMMENT 'Numéro du nom (ou numéro nomenclatural ou nn) saisi par l''utilisateur, dans le cas où celui-ci est lié à un référentiel',
111
  `accepted_sci_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Nom retenu',
112
  `accepted_sci_name_id` int(11) DEFAULT NULL COMMENT 'Numéro du nom (ou numéro nomenclatural ou nn) retenu',
113
  `plantnet_id` int(11) DEFAULT NULL COMMENT 'Identifiant plantnet',
114
  `family` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Famille du taxon auquel appartient l''observation',
115
  `certainty` enum('à déterminer','douteux','certain') COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Certitude de l identification taxonomique(DC2Type:certaintyenum)',
116
  `annotation` text COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Commentaires concernant l''obs',
117
  `occurrence_type` enum('observation de terrain','issue de la bibliographie','donnée d''herbier') COLLATE utf8mb4_unicode_ci DEFAULT 'observation de terrain' COMMENT 'Type de donnée - observation de terrain, issue de la bibliographie, donnée d''herbier(DC2Type:occurrencetypeenum)',
118
  `is_wild` tinyint(1) DEFAULT 1 COMMENT 'Indique si l''individu observé était sauvage ou cultivé',
119
  `coef` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
120
  `phenology` enum('00-09: germination, développement des bourgeons', '10-19: développement des feuilles', '11: environ 10% des feuilles épanouies', '15: environ 50% des feuilles épanouies', '20-29: formation de pousses latérales, tallage', '30-39: développement des tiges, croissance des rosettes', '40-49: développement des organes de propagation végétative', '50-59: apparition de l''inflorescence, épiaison', '60-69: floraison', '61: environ 10% des fleurs épanouies', '65: environ 50% des fleurs épanouies', '70-79: fructification', '80-89: maturité des fruits et des graines', '85: environ 50% des fruits matures', '90-99: sénescence et dormance', '91: environ 10% des feuilles sont tombées ou ont changé de couleur', '95: environ 50% des feuilles sont tombées ou ont changé de couleur') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
121
  `sample_herbarium` tinyint(1) DEFAULT 0 COMMENT 'Indique la présence / l''absence d''une part d''herbier associée à l''obs',
122
  `bibliography_source` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Source bibliographique',
123
  `input_source` enum('CEL','widget','VegLab','PlantNet','autre') COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Interface utilisée pour la saisie de l''obs - CEL, VegLab, widget,  PlantNet, autre(DC2Type:inputsourceenum)',
124
  `is_public` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Indique si l''obs est publique ou non',
125
  `is_visible_in_cel` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'Indique si l''obs s''affiche dans le CEL ou non',
126
  `is_visible_in_veg_lab` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Indique si l''obs s''affiche dans VegLab ou non',
127
  `signature` text COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Vérification des doublons',
128
  `geometry` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Localisation précise de l''obs',
129
  `elevation` int(11) DEFAULT NULL COMMENT 'Altitude',
130
  `geodatum` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'WGS84' COMMENT 'Système géodésique',
131
  `locality` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Localité où se trouve l''obs',
3664 delphine 132
  `locality_insee_code` varchar(5) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Code INSEE de la localité où se trouve l''obs',
3458 delphine 133
  `sublocality` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Lieu-dit',
134
  `environment` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Milieu, type d''habitat',
135
  `locality_consistency` tinyint(1) DEFAULT NULL COMMENT 'Cohérence entre les coordonnées et la localité',
136
  `station` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'The string to show in the dropdown ',
137
  `published_location` enum('précise','localité','10x10km') COLLATE utf8mb4_unicode_ci DEFAULT 'précise' COMMENT 'Précision géographique à laquelle est publiée l''obs, permet de gérer le floutage(DC2Type:publishedlocationenum)',
138
  `location_accuracy` enum('0 à 10 m','10 à 100 m','100 à 500 m','Lieu-dit','Localité') COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Précision (ou incertitude) de la localisation(DC2Type:locationaccuracytypeenum)',
139
  `osm_county` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Champ complété automatiquement par osm - comté',
140
  `osm_state` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Champ complété automatiquement par osm - état',
141
  `osm_postcode` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Champ complété automatiquement par osm - code postal',
142
  `osm_country` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Champ complété automatiquement par osm - pays',
143
  `osm_country_code` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Champ complété automatiquement par osm - code pays',
144
  `osm_id` bigint(20) DEFAULT NULL COMMENT 'Champ complété automatiquement par osm - id osm',
145
  `osm_place_id` int(11) DEFAULT NULL COMMENT 'Champ complété automatiquement par osm - id de l''instance géographique',
146
  `identiplante_score` int(11) DEFAULT 0 COMMENT 'Score de l''observation sur identiplante',
147
  `is_identiplante_validated` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Statut validé (ou non) de l''observation sur identiplante',
148
  `identification_author` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Nom de la personne ayant identifié l''espèce observée (si différente de l''observateur)',
149
  `taxo_repo` varchar(25) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Référentiel taxonomique',
150
  PRIMARY KEY (`id`),
151
  KEY `IDX_BEFD81F3166D1F9C` (`project_id`),
152
  KEY `user_id_idx` (`user_id`)
153
) ENGINE=InnoDB AUTO_INCREMENT=1630 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
154
 
155
--
156
-- Table structure for table `extended_field`
157
--
158
 
159
DROP TABLE IF EXISTS `extended_field`;
160
CREATE TABLE `extended_field` (
161
  `id` int(11) NOT NULL AUTO_INCREMENT,
162
  `project_id` int(11) DEFAULT NULL,
163
  `field_id` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
164
  `project` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
3664 delphine 165
  `data_type` varchar(50),
3458 delphine 166
  `is_visible` tinyint(1) NOT NULL COMMENT 'Champ invisible de l''utilisateur mais nécessaire au projet\n     ',
167
  `is_mandatory` tinyint(1) NOT NULL COMMENT 'Indique si le champ est obligatoire pour envoyer la donnée ou non',
168
  `min_value` decimal(10,0) DEFAULT NULL,
169
  `max_value` decimal(10,0) DEFAULT NULL,
170
  `regexp` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Format de la valeur (ex adresse mail, numéro de tel)',
171
  `unit` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Unité',
172
  PRIMARY KEY (`id`),
173
  UNIQUE KEY `key_fieldid_project` (`field_id`,`project`),
174
  KEY `IDX_76A19DBE166D1F9C` (`project_id`)
175
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Champs étendus';
176
 
177
--
178
-- Table structure for table `extendedfield_translation`
179
--
180
 
181
DROP TABLE IF EXISTS `extendedfield_translation`;
182
CREATE TABLE `extendedfield_translation` (
183
  `id` int(11) NOT NULL AUTO_INCREMENT,
184
  `extended_field_id` varchar(50) DEFAULT NULL,
185
  `project` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
186
  `label` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Intitulé',
187
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Description du champ',
188
  `default_value` text COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Valeur par défaut',
189
  `error_message` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Message d''erreur',
190
  `language_iso_code` varchar(3) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Code iso de la langue',
191
  `help` varchar(15) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Type mime de l''image décrivant le champ',
192
   PRIMARY KEY (`id`),
193
  UNIQUE KEY `index_fild_project_language` (`extended_field_id`,`project`,`language_iso_code`),
194
  KEY `IDX_169442A8CCBF7175` (`extended_field_id`)
195
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Contient le label et les valeurs par défaut d''un champ supplémentaire.';
196
 
197
 
198
 
199
--
200
-- Table structure for table `extended_field_occurrence`
201
--
202
 
203
DROP TABLE IF EXISTS `extended_field_occurrence`;
204
CREATE TABLE `extended_field_occurrence` (
205
  `id` int(11) NOT NULL AUTO_INCREMENT,
206
  `occurrence_id` int(11) NOT NULL,
207
  `extended_field_id` int(11) NOT NULL,
208
  `value` text COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Valeur renseignée par l''utilisateur',
209
  PRIMARY KEY (`id`),
210
  KEY `IDX_7DFE29EF30572FAC` (`occurrence_id`),
211
  KEY `IDX_7DFE29EFCCBF7175` (`extended_field_id`)
212
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
213
 
214
--
215
-- Table structure for table `user_occurrence_tag`
216
--
217
 
218
DROP TABLE IF EXISTS `user_occurrence_tag`;
219
CREATE TABLE `user_occurrence_tag` (
220
  `id` int(11) NOT NULL AUTO_INCREMENT,
221
  `user_id` int(11) NOT NULL COMMENT 'ID de l''utilisateur',
222
  `name` varchar(190) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
223
  `path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Hiérarchie (mots clés parents séparés par des /)',
224
  PRIMARY KEY (`id`),
225
  KEY `user_id_idx` (`user_id`)
226
) ENGINE=InnoDB AUTO_INCREMENT=95 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Les noms de tags utilisateurs doivent être uniques (pour un même utilisateur).';
227
 
228
 
229
 
230
--
231
-- Table structure for table `occurrence_user_occurrence_tag`
232
--
233
 
234
DROP TABLE IF EXISTS `occurrence_user_occurrence_tag`;
235
CREATE TABLE `occurrence_user_occurrence_tag` (
236
  `id` int(11) NOT NULL AUTO_INCREMENT,
237
  `occurrence_id` int(11) NOT NULL,
238
  `user_occurrence_tag_id` int(11) NOT NULL,
239
  PRIMARY KEY (`id`),
240
  KEY `IDX_B06FBA5830572FAC` (`occurrence_id`),
241
  KEY `IDX_B06FBA58768D75C5` (`user_occurrence_tag_id`)
242
) ENGINE=InnoDB AUTO_INCREMENT=1211 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Table de jointure entre occurrence et user_occurrence_tag.';
243
 
244
--
245
-- Table structure for table `occurrence_validation`
246
--
247
 
248
DROP TABLE IF EXISTS `occurrence_validation`;
249
CREATE TABLE `occurrence_validation` (
250
  `id` int(11) NOT NULL AUTO_INCREMENT,
251
  `occurrence_id` int(11) DEFAULT NULL,
252
  PRIMARY KEY (`id`),
253
  KEY `IDX_C8C4281C30572FAC` (`occurrence_id`)
254
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
255
 
256
--
257
-- Table structure for table `photo`
258
--
259
 
260
DROP TABLE IF EXISTS `photo`;
261
CREATE TABLE `photo` (
262
  `id` int(11) NOT NULL AUTO_INCREMENT,
263
  `occurrence_id` int(11) DEFAULT NULL,
264
  `user_id` int(11) DEFAULT NULL COMMENT 'ID de l''utilisateur',
265
  `user_email` varchar(155) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Email de l''utilisateur',
266
  `user_pseudo` varchar(155) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Pseudo de l''utilisateur propriétaire de la photo. Nom/Prénom si non renseigné.',
267
  `original_name` tinytext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Nom du fichier image',
268
  `date_shot` datetime DEFAULT NULL COMMENT 'Date de la prise de vue',
269
  `latitude` double DEFAULT NULL COMMENT 'Latitude de la photo',
270
  `longitude` double DEFAULT NULL COMMENT 'Longitude de la photo',
271
  `date_created` datetime DEFAULT NULL COMMENT 'Date de l''import du fichier',
272
  `date_updated` datetime DEFAULT NULL COMMENT 'Date de dernière modification',
273
  `date_linked_to_occurrence` datetime DEFAULT NULL COMMENT 'Date à laquelle la photo a été liée à une obs',
274
  `content_url` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
275
  `size` int(11) DEFAULT NULL,
276
  `mime_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
277
  `url` varchar(70) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
278
  PRIMARY KEY (`id`),
279
  KEY `IDX_14B7841830572FAC` (`occurrence_id`),
280
  KEY `user_id_idx` (`user_id`)
281
) ENGINE=InnoDB AUTO_INCREMENT=179 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Les noms originaux doivent être uniques pour un même utilisateur.';
282
 
283
--
284
-- Table structure for table `photo_tag`
285
--
286
 
287
DROP TABLE IF EXISTS `photo_tag`;
288
CREATE TABLE `photo_tag` (
289
  `id` int(11) NOT NULL AUTO_INCREMENT,
290
  `user_id` int(11) NOT NULL COMMENT 'ID de l''utilisateur',
291
  `name` varchar(190) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
292
  `path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Hiérarchie (mots clés parents séparés par des /)',
293
  PRIMARY KEY (`id`),
294
  KEY `user_id_idx` (`user_id`)
295
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Mot-clé photo';
296
 
297
--
298
-- Table structure for table `photo_tag_photo`
299
--
300
 
301
DROP TABLE IF EXISTS `photo_tag_photo`;
302
CREATE TABLE `photo_tag_photo` (
303
  `id` int(11) NOT NULL AUTO_INCREMENT,
304
  `photo_id` int(11) NOT NULL,
305
  `photo_tag_id` int(11) NOT NULL,
306
  PRIMARY KEY (`id`),
307
  KEY `IDX_3BA5CB3F7E9E4C8C` (`photo_id`),
308
  KEY `IDX_3BA5CB3FEF6D1439` (`photo_tag_id`)
309
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Table de jointure entre Photo et PhotoTag.';
310
 
311
 
312
--
313
-- Table structure for table `user_custom_field`
314
--
315
 
316
DROP TABLE IF EXISTS `user_custom_field`;
317
CREATE TABLE `user_custom_field` (
318
  `id` int(11) NOT NULL AUTO_INCREMENT,
319
  `user_id` int(11) DEFAULT NULL,
320
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Intitulé du champ',
321
  `data_type` enum('Booléen','Texte','Date','Entier','Décimal') COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Type de champ - Texte, Nombre, Date, Booléen(DC2Type:fielddatatypeenum)',
322
  `unit` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Unité employée pour le champ',
323
  `default_value` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT ' Valeur par défaut',
324
  PRIMARY KEY (`id`),
325
  KEY `IDX_1834C1336B9DD454` (`user_id`)
326
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Champs personnalisés de l''utilisateur';
327
 
328
--
329
-- Table structure for table `user_custom_field_occurrence`
330
--
331
 
332
DROP TABLE IF EXISTS `user_custom_field_occurrence`;
333
CREATE TABLE `user_custom_field_occurrence` (
334
  `id` int(11) NOT NULL AUTO_INCREMENT,
335
  `occurrence_id` int(11) NOT NULL,
336
  `user_custom_field_id` int(11) NOT NULL,
337
  `value` text COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Valeur renseignée par l''utilisateur',
338
  PRIMARY KEY (`id`),
339
  KEY `IDX_27C0824930572FAC` (`occurrence_id`),
340
  KEY `IDX_27C08249B3398C5B` (`user_custom_field_id`)
341
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;