1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
|
-- MySQL dump 10.13 Distrib 5.5.47, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: gestion
-- ------------------------------------------------------
-- Server version 5.5.47-0+deb8u1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `adherent_role_types`
--
DROP TABLE IF EXISTS `adherent_role_types`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `adherent_role_types` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`list_name` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `adherent_roles`
--
DROP TABLE IF EXISTS `adherent_roles`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `adherent_roles` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`adherent_id` int(11) NOT NULL,
`adherent_role_type_id` int(11) NOT NULL,
`ville_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `id_adherent` (`adherent_id`),
KEY `id_adherent_role_type` (`adherent_role_type_id`),
KEY `id_ville` (`ville_id`),
CONSTRAINT `adherent_roles_ibfk_1` FOREIGN KEY (`adherent_id`) REFERENCES `adherents` (`id`) ON UPDATE CASCADE,
CONSTRAINT `adherent_roles_ibfk_2` FOREIGN KEY (`adherent_role_type_id`) REFERENCES `adherent_role_types` (`id`) ON UPDATE CASCADE,
CONSTRAINT `adherent_roles_ibfk_3` FOREIGN KEY (`ville_id`) REFERENCES `villes` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `adherent_statuts`
--
DROP TABLE IF EXISTS `adherent_statuts`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `adherent_statuts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `title` (`title`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `adherent_types`
--
DROP TABLE IF EXISTS `adherent_types`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `adherent_types` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `adherents`
--
DROP TABLE IF EXISTS `adherents`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `adherents` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id = numéro ADT',
`nom` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`prenom` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`raison` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`tel_mobile1` varchar(12) COLLATE utf8_unicode_ci DEFAULT NULL,
`adherent_type_id` int(11) NOT NULL,
`ville_id` int(11) NOT NULL,
`adherent_statut_id` int(11) NOT NULL,
`civilite_id` int(11) NOT NULL,
`nom2` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL,
`prenom2` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL,
`mail1` varchar(48) COLLATE utf8_unicode_ci DEFAULT NULL,
`mail2` varchar(48) COLLATE utf8_unicode_ci DEFAULT NULL,
`adresse1` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`adresse2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`tel_fixe1` varchar(12) COLLATE utf8_unicode_ci DEFAULT NULL,
`tel_fixe2` varchar(12) COLLATE utf8_unicode_ci DEFAULT NULL,
`tel_mobile2` varchar(12) COLLATE utf8_unicode_ci DEFAULT NULL,
`num_adt_ttn` char(6) COLLATE utf8_unicode_ci DEFAULT NULL,
`created` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Date de la première saisie de l''adhérent',
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Date de la dernière modification de l''adhérent',
`proprio` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`notes` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
KEY `ville` (`ville_id`),
KEY `adherent_type_id` (`adherent_type_id`),
KEY `civilite_id` (`civilite_id`),
KEY `adherent_statut` (`adherent_statut_id`),
CONSTRAINT `adherents_ibfk_1` FOREIGN KEY (`ville_id`) REFERENCES `villes` (`id`) ON UPDATE CASCADE,
CONSTRAINT `adherents_ibfk_2` FOREIGN KEY (`adherent_type_id`) REFERENCES `adherent_types` (`id`) ON UPDATE CASCADE,
CONSTRAINT `adherents_ibfk_3` FOREIGN KEY (`civilite_id`) REFERENCES `civilites` (`id`) ON UPDATE CASCADE,
CONSTRAINT `adherents_ibfk_4` FOREIGN KEY (`adherent_statut_id`) REFERENCES `adherent_statuts` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Adhérents';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `civilites`
--
DROP TABLE IF EXISTS `civilites`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `civilites` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `equipement_modeles`
--
DROP TABLE IF EXISTS `equipement_modeles`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `equipement_modeles` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`constructeur` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`modele` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`profile` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL,
`revision` varchar(8) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Modèles d''équipements';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `equipement_modes`
--
DROP TABLE IF EXISTS `equipement_modes`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `equipement_modes` (
`id` char(8) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `equipements`
--
DROP TABLE IF EXISTS `equipements`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `equipements` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uplink_id` int(11) DEFAULT NULL,
`service_id` int(11) DEFAULT NULL,
`mac` char(17) COLLATE utf8_unicode_ci NOT NULL,
`hostname` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`equipement_modele_id` int(11) NOT NULL,
`ipmgmt_id` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL,
`relais_id` int(11) DEFAULT NULL,
`equipement_mode_id` char(8) COLLATE utf8_unicode_ci NOT NULL,
`description` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`date_achat` date DEFAULT NULL,
`date_hs` date DEFAULT NULL,
`notes` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
UNIQUE KEY `mac` (`mac`),
UNIQUE KEY `ipmgmt_id` (`ipmgmt_id`),
KEY `relais_id` (`relais_id`),
KEY `equipement_mode_id` (`equipement_mode_id`),
KEY `equipement_modele_id` (`equipement_modele_id`),
KEY `service_id` (`service_id`),
KEY `uplink_id` (`uplink_id`),
CONSTRAINT `equipements_ibfk_1` FOREIGN KEY (`equipement_modele_id`) REFERENCES `equipement_modeles` (`id`) ON UPDATE CASCADE,
CONSTRAINT `equipements_ibfk_4` FOREIGN KEY (`service_id`) REFERENCES `services` (`id`),
CONSTRAINT `equipements_ibfk_5` FOREIGN KEY (`relais_id`) REFERENCES `relais` (`id`) ON UPDATE CASCADE,
CONSTRAINT `equipements_ibfk_6` FOREIGN KEY (`equipement_mode_id`) REFERENCES `equipement_modes` (`id`) ON UPDATE CASCADE,
CONSTRAINT `equipements_ibfk_8` FOREIGN KEY (`uplink_id`) REFERENCES `equipements` (`id`) ON UPDATE CASCADE,
CONSTRAINT `equipements_ibfk_9` FOREIGN KEY (`ipmgmt_id`) REFERENCES `ipmgmt` (`ip4`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Matériel en circulation';
/*!40101 SET character_set_client = @saved_cs_client */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8mb4 */ ;
/*!50003 SET character_set_results = utf8mb4 */ ;
/*!50003 SET collation_connection = utf8mb4_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`gestion`@`localhost`*/ /*!50003 TRIGGER `equipements_insert` BEFORE INSERT ON `equipements` FOR EACH ROW BEGIN
-- INSERT NULL instead of '' for VARCHAR columns (prevents UNIQUE FK FAIL)
SET NEW.ipmgmt_id = IF(NEW.ipmgmt_id = '', NULL, NEW.ipmgmt_id);
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8mb4 */ ;
/*!50003 SET character_set_results = utf8mb4 */ ;
/*!50003 SET collation_connection = utf8mb4_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`gestion`@`localhost`*/ /*!50003 TRIGGER `equipements_update` BEFORE UPDATE ON `equipements` FOR EACH ROW BEGIN
-- INSERT NULL instead of '' for VARCHAR columns (prevents UNIQUE FK FAIL)
SET NEW.ipmgmt_id = IF(NEW.ipmgmt_id = '', NULL, NEW.ipmgmt_id);
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
--
-- Table structure for table `interesse_statuts`
--
DROP TABLE IF EXISTS `interesse_statuts`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `interesse_statuts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `title` (`title`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `interesses`
--
DROP TABLE IF EXISTS `interesses`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `interesses` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`date_demande` date NOT NULL,
`civilite_id` int(11) NOT NULL,
`nom` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`prenom` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`raison` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`ville_id` int(11) NOT NULL,
`interesse_statut_id` int(11) NOT NULL,
`telephone` varchar(12) COLLATE utf8_unicode_ci DEFAULT NULL,
`mail` varchar(48) COLLATE utf8_unicode_ci DEFAULT NULL,
`adresse1` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`adresse2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`notes` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`),
KEY `civilite_id` (`civilite_id`),
KEY `ville_id` (`ville_id`),
KEY `interesse_statut_id` (`interesse_statut_id`),
CONSTRAINT `interesses_ibfk_1` FOREIGN KEY (`civilite_id`) REFERENCES `civilites` (`id`) ON UPDATE CASCADE,
CONSTRAINT `interesses_ibfk_2` FOREIGN KEY (`ville_id`) REFERENCES `villes` (`id`) ON UPDATE CASCADE,
CONSTRAINT `interesses_ibfk_3` FOREIGN KEY (`interesse_statut_id`) REFERENCES `interesse_statuts` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `ipmgmt`
--
DROP TABLE IF EXISTS `ipmgmt`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ipmgmt` (
`ip4` varchar(15) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
PRIMARY KEY (`ip4`),
UNIQUE KEY `ip` (`ip4`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `ippubliques`
--
DROP TABLE IF EXISTS `ippubliques`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ippubliques` (
`ip4` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
`ip6` varchar(39) COLLATE utf8_unicode_ci DEFAULT NULL,
`secteur_id` int(11) DEFAULT NULL,
PRIMARY KEY (`ip4`),
UNIQUE KEY `ip6` (`ip6`),
KEY `secteur_id` (`secteur_id`),
CONSTRAINT `ippubliques_ibfk_1` FOREIGN KEY (`secteur_id`) REFERENCES `secteurs` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `periodicites`
--
DROP TABLE IF EXISTS `periodicites`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `periodicites` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `relais`
--
DROP TABLE IF EXISTS `relais`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `relais` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`ville_id` int(11) NOT NULL,
`secteur_id` int(11) NOT NULL,
`gps_long` float(10,7) NOT NULL,
`gps_lat` float(10,7) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `title` (`title`),
KEY `ville_id` (`ville_id`),
KEY `id_secteur` (`secteur_id`),
CONSTRAINT `relais_ibfk_2` FOREIGN KEY (`secteur_id`) REFERENCES `secteurs` (`id`) ON UPDATE CASCADE,
CONSTRAINT `relais_ibfk_3` FOREIGN KEY (`ville_id`) REFERENCES `villes` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `secteurs`
--
DROP TABLE IF EXISTS `secteurs`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `secteurs` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `title` (`title`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Différents secteurs de déploiement';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `service_statuts`
--
DROP TABLE IF EXISTS `service_statuts`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `service_statuts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `service_types`
--
DROP TABLE IF EXISTS `service_types`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `service_types` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`prix_base_ht` decimal(7,2) NOT NULL,
`periodicite_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `periodicite_id` (`periodicite_id`),
CONSTRAINT `service_types_ibfk_1` FOREIGN KEY (`periodicite_id`) REFERENCES `periodicites` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Services disponibles';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `services`
--
DROP TABLE IF EXISTS `services`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `services` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`adherent_id` int(11) NOT NULL,
`service_type_id` int(11) NOT NULL,
`service_statut_id` int(11) NOT NULL,
`ippublique_id` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL,
`prix_ht` decimal(7,2) DEFAULT NULL,
`date_debut` datetime DEFAULT NULL,
`date_fin` datetime DEFAULT NULL,
`description` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`created` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`lat` float(10,7) DEFAULT NULL,
`lng` float(10,7) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `id_adherent` (`adherent_id`),
KEY `id_type` (`service_type_id`),
KEY `service_statut_id` (`service_statut_id`),
KEY `ip4publique_id` (`ippublique_id`),
CONSTRAINT `services_ibfk_1` FOREIGN KEY (`adherent_id`) REFERENCES `adherents` (`id`),
CONSTRAINT `services_ibfk_2` FOREIGN KEY (`service_type_id`) REFERENCES `service_types` (`id`) ON UPDATE CASCADE,
CONSTRAINT `services_ibfk_4` FOREIGN KEY (`service_statut_id`) REFERENCES `service_statuts` (`id`) ON UPDATE CASCADE,
CONSTRAINT `services_ibfk_5` FOREIGN KEY (`ippublique_id`) REFERENCES `ippubliques` (`ip4`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Services souscrits par les adhérents';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Temporary table structure for view `v_adt_sms`
--
DROP TABLE IF EXISTS `v_adt_sms`;
/*!50001 DROP VIEW IF EXISTS `v_adt_sms`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `v_adt_sms` (
`id` tinyint NOT NULL,
`tel_mobile1` tinyint NOT NULL,
`tel_mobile2` tinyint NOT NULL,
`tel_contact` tinyint NOT NULL,
`mail_contact` tinyint NOT NULL,
`relais` tinyint NOT NULL
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
--
-- Temporary table structure for view `v_api_gen_conf`
--
DROP TABLE IF EXISTS `v_api_gen_conf`;
/*!50001 DROP VIEW IF EXISTS `v_api_gen_conf`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `v_api_gen_conf` (
`do_conf` tinyint NOT NULL,
`etat` tinyint NOT NULL,
`svc_id` tinyint NOT NULL,
`ip4_nexthop` tinyint NOT NULL,
`ip4_public` tinyint NOT NULL,
`ip6_nexthop` tinyint NOT NULL,
`ip6_prefix` tinyint NOT NULL
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
--
-- Temporary table structure for view `v_api_gen_firm`
--
DROP TABLE IF EXISTS `v_api_gen_firm`;
/*!50001 DROP VIEW IF EXISTS `v_api_gen_firm`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `v_api_gen_firm` (
`ippublique_id` tinyint NOT NULL,
`nom` tinyint NOT NULL,
`prenom` tinyint NOT NULL,
`raison` tinyint NOT NULL,
`constructeur` tinyint NOT NULL,
`modele` tinyint NOT NULL,
`profile` tinyint NOT NULL,
`revision` tinyint NOT NULL,
`ip6prefix` tinyint NOT NULL,
`ip4wan` tinyint NOT NULL
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
--
-- Temporary table structure for view `v_relais`
--
DROP TABLE IF EXISTS `v_relais`;
/*!50001 DROP VIEW IF EXISTS `v_relais`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `v_relais` (
`relais_id` tinyint NOT NULL,
`relais` tinyint NOT NULL,
`secteur` tinyint NOT NULL,
`nb_connectes` tinyint NOT NULL
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
--
-- Temporary table structure for view `v_relais_detail`
--
DROP TABLE IF EXISTS `v_relais_detail`;
/*!50001 DROP VIEW IF EXISTS `v_relais_detail`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `v_relais_detail` (
`relais` tinyint NOT NULL,
`adt` tinyint NOT NULL,
`adt_title` tinyint NOT NULL,
`adherent_id` tinyint NOT NULL,
`service_id` tinyint NOT NULL,
`service` tinyint NOT NULL,
`routeur_equipement_id` tinyint NOT NULL,
`antenne1_equipement_id` tinyint NOT NULL,
`antenne2_equipement_id` tinyint NOT NULL,
`relais_id` tinyint NOT NULL,
`relais_degre` tinyint NOT NULL,
`secteur_id` tinyint NOT NULL
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
--
-- Temporary table structure for view `v_secteurs`
--
DROP TABLE IF EXISTS `v_secteurs`;
/*!50001 DROP VIEW IF EXISTS `v_secteurs`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `v_secteurs` (
`id` tinyint NOT NULL,
`secteur` tinyint NOT NULL,
`nb_connectes` tinyint NOT NULL
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
--
-- Temporary table structure for view `v_sympa_adherents`
--
DROP TABLE IF EXISTS `v_sympa_adherents`;
/*!50001 DROP VIEW IF EXISTS `v_sympa_adherents`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `v_sympa_adherents` (
`mail` tinyint NOT NULL
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
--
-- Temporary table structure for view `v_sympa_referents`
--
DROP TABLE IF EXISTS `v_sympa_referents`;
/*!50001 DROP VIEW IF EXISTS `v_sympa_referents`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `v_sympa_referents` (
`mail` tinyint NOT NULL,
`village_list_name` tinyint NOT NULL,
`sms_list_name` tinyint NOT NULL
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
--
-- Temporary table structure for view `v_sympa_roles`
--
DROP TABLE IF EXISTS `v_sympa_roles`;
/*!50001 DROP VIEW IF EXISTS `v_sympa_roles`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `v_sympa_roles` (
`mail` tinyint NOT NULL,
`list_name` tinyint NOT NULL
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
--
-- Table structure for table `villes`
--
DROP TABLE IF EXISTS `villes`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `villes` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`cp` char(5) COLLATE utf8_unicode_ci NOT NULL,
`tel_contact` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `title` (`title`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Final view structure for view `v_adt_sms`
--
/*!50001 DROP TABLE IF EXISTS `v_adt_sms`*/;
/*!50001 DROP VIEW IF EXISTS `v_adt_sms`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
/*!50001 SET character_set_client = utf8mb4 */;
/*!50001 SET character_set_results = utf8mb4 */;
/*!50001 SET collation_connection = utf8mb4_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`gestion`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `v_adt_sms` AS select concat('CHD-',`a`.`id`) AS `id`,`a`.`tel_mobile1` AS `tel_mobile1`,`a`.`tel_mobile2` AS `tel_mobile2`,`v`.`tel_contact` AS `tel_contact`,concat(lcase(replace(`v`.`title`,' ','-')),'@chd.sx') AS `mail_contact`,`re`.`title` AS `relais` from (((((((`adherents` `a` left join `villes` `v` on((`v`.`id` = `a`.`ville_id`))) left join `services` `s` on((`s`.`adherent_id` = `a`.`id`))) left join `equipements` `rt` on((`rt`.`service_id` = `s`.`id`))) left join `equipements` `a1` on((`a1`.`id` = `rt`.`uplink_id`))) left join `equipements` `a2` on((`a2`.`id` = `a1`.`uplink_id`))) left join `relais` `re` on((`re`.`id` = coalesce(`rt`.`relais_id`,`a1`.`relais_id`,`a2`.`relais_id`)))) left join `secteurs` `sec` on((`sec`.`id` = `re`.`secteur_id`))) where ((`a`.`adherent_statut_id` <> 1) and (`s`.`service_type_id` in (2,3,4)) and (`s`.`service_statut_id` = 4)) */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
--
-- Final view structure for view `v_api_gen_conf`
--
/*!50001 DROP TABLE IF EXISTS `v_api_gen_conf`*/;
/*!50001 DROP VIEW IF EXISTS `v_api_gen_conf`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
/*!50001 SET character_set_client = utf8mb4 */;
/*!50001 SET character_set_results = utf8mb4 */;
/*!50001 SET collation_connection = utf8mb4_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`gestion`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `v_api_gen_conf` AS select 'do_conf' AS `do_conf`,'actif' AS `etat`,concat('SER-',`s`.`id`) AS `svc_id`,`routeur`.`ipmgmt_id` AS `ip4_nexthop`,`ipp`.`ip4` AS `ip4_public`,`CALC_WANIP6LL`(`ipp`.`ip6`) AS `ip6_nexthop`,`ipp`.`ip6` AS `ip6_prefix` from ((((`services` `s` left join `service_types` `st` on((`st`.`id` = `s`.`service_type_id`))) left join `ippubliques` `ipp` on((`ipp`.`ip4` = `s`.`ippublique_id`))) left join `adherents` `a` on((`s`.`adherent_id` = `a`.`id`))) left join `equipements` `routeur` on(((`routeur`.`service_id` = `s`.`id`) and (`routeur`.`equipement_mode_id` in ('rt-soho','rt-sta'))))) where ((`s`.`service_type_id` in (2,3,4)) and (`s`.`service_statut_id` in (2,4)) and (`a`.`adherent_statut_id` <> 1)) */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
--
-- Final view structure for view `v_api_gen_firm`
--
/*!50001 DROP TABLE IF EXISTS `v_api_gen_firm`*/;
/*!50001 DROP VIEW IF EXISTS `v_api_gen_firm`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
/*!50001 SET character_set_client = utf8mb4 */;
/*!50001 SET character_set_results = utf8mb4 */;
/*!50001 SET collation_connection = utf8mb4_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`gestion`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `v_api_gen_firm` AS select `s`.`ippublique_id` AS `ippublique_id`,`a`.`nom` AS `nom`,`a`.`prenom` AS `prenom`,`a`.`raison` AS `raison`,`em`.`constructeur` AS `constructeur`,`em`.`modele` AS `modele`,`em`.`profile` AS `profile`,`em`.`revision` AS `revision`,`ip`.`ip6` AS `ip6prefix`,`e`.`ipmgmt_id` AS `ip4wan` from ((((`services` `s` left join `adherents` `a` on((`a`.`id` = `s`.`adherent_id`))) left join `ippubliques` `ip` on((`ip`.`ip4` = `s`.`ippublique_id`))) left join `equipements` `e` on((`e`.`service_id` = `s`.`id`))) left join `equipement_modeles` `em` on((`em`.`id` = `e`.`equipement_modele_id`))) where ((`s`.`service_statut_id` = 4) and (`s`.`ippublique_id` is not null)) */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
--
-- Final view structure for view `v_relais`
--
/*!50001 DROP TABLE IF EXISTS `v_relais`*/;
/*!50001 DROP VIEW IF EXISTS `v_relais`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
/*!50001 SET character_set_client = utf8mb4 */;
/*!50001 SET character_set_results = utf8mb4 */;
/*!50001 SET collation_connection = utf8mb4_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`gestion`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `v_relais` AS select `v`.`relais_id` AS `relais_id`,`v`.`relais` AS `relais`,`s`.`title` AS `secteur`,count(0) AS `nb_connectes` from (`v_relais_detail` `v` left join `secteurs` `s` on((`v`.`secteur_id` = `s`.`id`))) group by `v`.`relais_id`,`v`.`relais`,`s`.`title` */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
--
-- Final view structure for view `v_relais_detail`
--
/*!50001 DROP TABLE IF EXISTS `v_relais_detail`*/;
/*!50001 DROP VIEW IF EXISTS `v_relais_detail`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
/*!50001 SET character_set_client = utf8mb4 */;
/*!50001 SET character_set_results = utf8mb4 */;
/*!50001 SET collation_connection = utf8mb4_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`gestion`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `v_relais_detail` AS select `re`.`title` AS `relais`,concat('CHD-',`a`.`id`) AS `adt`,concat_ws(' ',nullif(`a`.`raison`,''),`a`.`nom`,`a`.`prenom`) AS `adt_title`,`a`.`id` AS `adherent_id`,`s`.`id` AS `service_id`,concat('SER-',`s`.`id`) AS `service`,`rt`.`id` AS `routeur_equipement_id`,`a1`.`id` AS `antenne1_equipement_id`,`a2`.`id` AS `antenne2_equipement_id`,`re`.`id` AS `relais_id`,(case when (`rt`.`relais_id` is not null) then 1 when (`a1`.`relais_id` is not null) then 2 when (`a2`.`relais_id` is not null) then 3 else NULL end) AS `relais_degre`,`sec`.`id` AS `secteur_id` from ((((((`adherents` `a` left join `services` `s` on((`s`.`adherent_id` = `a`.`id`))) left join `equipements` `rt` on((`rt`.`service_id` = `s`.`id`))) left join `equipements` `a1` on((`a1`.`id` = `rt`.`uplink_id`))) left join `equipements` `a2` on((`a2`.`id` = `a1`.`uplink_id`))) left join `relais` `re` on((`re`.`id` = coalesce(`rt`.`relais_id`,`a1`.`relais_id`,`a2`.`relais_id`)))) left join `secteurs` `sec` on((`sec`.`id` = `re`.`secteur_id`))) where ((`a`.`adherent_statut_id` <> 1) and (`s`.`service_type_id` in (2,3,4)) and (`s`.`service_statut_id` in (1,2,4))) order by 1 */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
--
-- Final view structure for view `v_secteurs`
--
/*!50001 DROP TABLE IF EXISTS `v_secteurs`*/;
/*!50001 DROP VIEW IF EXISTS `v_secteurs`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
/*!50001 SET character_set_client = utf8mb4 */;
/*!50001 SET character_set_results = utf8mb4 */;
/*!50001 SET collation_connection = utf8mb4_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`gestion`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `v_secteurs` AS select `s`.`id` AS `id`,`s`.`title` AS `secteur`,count(0) AS `nb_connectes` from (`v_relais_detail` `v` left join `secteurs` `s` on((`v`.`secteur_id` = `s`.`id`))) group by `s`.`id`,`s`.`title` */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
--
-- Final view structure for view `v_sympa_adherents`
--
/*!50001 DROP TABLE IF EXISTS `v_sympa_adherents`*/;
/*!50001 DROP VIEW IF EXISTS `v_sympa_adherents`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
/*!50001 SET character_set_client = utf8mb4 */;
/*!50001 SET character_set_results = utf8mb4 */;
/*!50001 SET collation_connection = utf8mb4_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`gestion`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `v_sympa_adherents` AS select distinct `a`.`mail1` AS `mail` from `adherents` `a` where ((length(`a`.`mail1`) > 5) and (`a`.`adherent_statut_id` <> 1)) */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
--
-- Final view structure for view `v_sympa_referents`
--
/*!50001 DROP TABLE IF EXISTS `v_sympa_referents`*/;
/*!50001 DROP VIEW IF EXISTS `v_sympa_referents`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
/*!50001 SET character_set_client = utf8mb4 */;
/*!50001 SET character_set_results = utf8mb4 */;
/*!50001 SET collation_connection = utf8mb4_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`gestion`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `v_sympa_referents` AS select `a`.`mail1` AS `mail`,lcase(replace(`v`.`title`,' ','-')) AS `village_list_name`,`v`.`tel_contact` AS `sms_list_name` from ((`adherent_roles` `ar` left join `adherents` `a` on((`ar`.`adherent_id` = `a`.`id`))) left join `villes` `v` on((`ar`.`ville_id` = `v`.`id`))) where ((`ar`.`adherent_role_type_id` = 7) and (length(`a`.`mail1`) > 5)) */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
--
-- Final view structure for view `v_sympa_roles`
--
/*!50001 DROP TABLE IF EXISTS `v_sympa_roles`*/;
/*!50001 DROP VIEW IF EXISTS `v_sympa_roles`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
/*!50001 SET character_set_client = utf8mb4 */;
/*!50001 SET character_set_results = utf8mb4 */;
/*!50001 SET collation_connection = utf8mb4_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`gestion`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `v_sympa_roles` AS select distinct `a`.`mail1` AS `mail`,`art`.`list_name` AS `list_name` from ((`adherent_roles` `ar` left join `adherents` `a` on((`ar`.`adherent_id` = `a`.`id`))) left join `adherent_role_types` `art` on((`ar`.`adherent_role_type_id` = `art`.`id`))) where (length(`a`.`mail1`) > 5) */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2016-06-12 16:55:19
|