Commit 8d4ada90747cde95f192bfa03c8e33e4d0ca219c
1 parent
02b1f815
Exists in
master
and in
3 other branches
Modification script d'installation pour le LATMOS
Showing
1 changed file
with
432 additions
and
0 deletions
Show diff stats
... | ... | @@ -0,0 +1,432 @@ |
1 | +-- phpMyAdmin SQL Dump | |
2 | +-- version 4.0.10deb1 | |
3 | +-- http://www.phpmyadmin.net | |
4 | +-- | |
5 | +-- Client: localhost | |
6 | +-- Généré le: Mar 19 Avril 2016 à 11:20 | |
7 | +-- Version du serveur: 5.5.47-0ubuntu0.14.04.1 | |
8 | +-- Version de PHP: 5.5.9-1ubuntu4.14 | |
9 | + | |
10 | +-- SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; | |
11 | +-- SET time_zone = "+00:00"; | |
12 | + | |
13 | + | |
14 | +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; | |
15 | +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; | |
16 | +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; | |
17 | +/*!40101 SET NAMES utf8 */; | |
18 | + | |
19 | +-- | |
20 | +-- Base de données: `mydb` | |
21 | + | |
22 | +USE mydb; | |
23 | +set foreign_key_checks=0; | |
24 | +-- -------------------------------------------------------- | |
25 | +-- | |
26 | +-- Structure de la table `categories` | |
27 | +-- | |
28 | + | |
29 | +DROP TABLE IF EXISTS `categories`; | |
30 | +CREATE TABLE IF NOT EXISTS `categories` ( | |
31 | + `id` int(11) NOT NULL AUTO_INCREMENT, | |
32 | + `nom` varchar(45) NOT NULL COMMENT 'obligatoire (et unique)', | |
33 | + `sur_categorie_id` int(11) NOT NULL, | |
34 | + PRIMARY KEY (`id`), | |
35 | + UNIQUE KEY `nom_UNIQUE` (`nom`), | |
36 | + KEY `fk_sur_categorie_id` (`sur_categorie_id`) | |
37 | +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=74 ; | |
38 | + | |
39 | + | |
40 | +-- -------------------------------------------------------- | |
41 | +-- | |
42 | +-- Structure de la table `documents` | |
43 | +-- | |
44 | + | |
45 | +DROP TABLE IF EXISTS `documents`; | |
46 | +CREATE TABLE IF NOT EXISTS `documents` ( | |
47 | + `id` int(11) NOT NULL AUTO_INCREMENT, | |
48 | + `type_doc` varchar(20) DEFAULT NULL, | |
49 | + `description` text DEFAULT NULL, | |
50 | + `nom` VARCHAR(100) DEFAULT NULL, | |
51 | + `materiel_id` int(11) DEFAULT NULL, | |
52 | + `suivi_id` int(11) DEFAULT NULL, | |
53 | + `type_document_id` int(11) DEFAULT NULL, | |
54 | + `photo` tinyint(1) DEFAULT NULL, | |
55 | + PRIMARY KEY (`id`), | |
56 | + KEY `fk_documents_materiel_id` (`materiel_id`), | |
57 | + KEY `fk_documents_suivi_id` (`suivi_id`) | |
58 | +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; | |
59 | + | |
60 | +-- -------------------------------------------------------- | |
61 | +-- | |
62 | +-- Structure de la table `emprunts` | |
63 | +-- | |
64 | + | |
65 | +DROP TABLE IF EXISTS `emprunts`; | |
66 | +CREATE TABLE IF NOT EXISTS `emprunts` ( | |
67 | + `id` int(11) NOT NULL AUTO_INCREMENT, | |
68 | + `materiel_id` int(11) NOT NULL, | |
69 | + `date_emprunt` date DEFAULT NULL, | |
70 | + `date_retour_emprunt` date DEFAULT NULL, | |
71 | + `emprunt_interne` tinyint(1) DEFAULT NULL, | |
72 | + `laboratoire` varchar(45) DEFAULT NULL, | |
73 | + `site_id` int(11) DEFAULT NULL, | |
74 | + `e_lieu_detail` varchar(45) DEFAULT NULL, | |
75 | + `nom_emprunteur` varchar(45) DEFAULT NULL, | |
76 | + `email_emprunteur` varchar(45) DEFAULT NULL, | |
77 | + `tel` varchar(20) DEFAULT NULL, | |
78 | + `commentaire` varchar(200) DEFAULT NULL, | |
79 | + `nom_createur` varchar(45) DEFAULT NULL COMMENT 'nom du createur de la fiche', | |
80 | + `nom_modificateur` varchar(45) DEFAULT NULL COMMENT 'nom du modificateur de la fiche', | |
81 | + `created` datetime DEFAULT NULL COMMENT 'date et heure de creation de la fiche', | |
82 | + `modified` datetime DEFAULT NULL COMMENT 'date et heure de modif de la fiche', | |
83 | + PRIMARY KEY (`id`), | |
84 | + KEY `fk_technical_materials_internal_loans_copy1_admi_materials1` (`materiel_id`) | |
85 | +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ; | |
86 | + | |
87 | + | |
88 | +-- -------------------------------------------------------- | |
89 | +-- | |
90 | +-- Structure de la table `groupes_metiers` | |
91 | +-- | |
92 | + | |
93 | +DROP TABLE IF EXISTS `groupes_metiers`; | |
94 | +CREATE TABLE IF NOT EXISTS `groupes_metiers` ( | |
95 | + `id` int(11) NOT NULL AUTO_INCREMENT, | |
96 | + `nom` varchar(45) DEFAULT NULL, | |
97 | + `description` varchar(100) DEFAULT NULL, | |
98 | + PRIMARY KEY (`id`) | |
99 | +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=10 ; | |
100 | + | |
101 | + | |
102 | +-- -------------------------------------------------------- | |
103 | +-- | |
104 | +-- Structure de la table `groupes_thematiques` | |
105 | +-- | |
106 | + | |
107 | +DROP TABLE IF EXISTS `groupes_thematiques`; | |
108 | +CREATE TABLE IF NOT EXISTS `groupes_thematiques` ( | |
109 | + `id` int(11) NOT NULL AUTO_INCREMENT, | |
110 | + `nom` varchar(45) DEFAULT NULL, | |
111 | + `description` varchar(100) DEFAULT NULL, | |
112 | + PRIMARY KEY (`id`) | |
113 | +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ; | |
114 | + | |
115 | + | |
116 | +-- -------------------------------------------------------- | |
117 | +-- | |
118 | +-- Structure de la table `materiels` | |
119 | +-- | |
120 | + | |
121 | +DROP TABLE IF EXISTS `materiels`; | |
122 | +CREATE TABLE IF NOT EXISTS `materiels` ( | |
123 | + `id` int(11) NOT NULL AUTO_INCREMENT, | |
124 | + `designation` varchar(50) DEFAULT NULL, | |
125 | + `sur_categorie_id` int(11) DEFAULT NULL, | |
126 | + `categorie_id` int(11) DEFAULT NULL, | |
127 | + `sous_categorie_id` int(11) DEFAULT NULL, | |
128 | + `numero_laboratoire` varchar(14) DEFAULT NULL, | |
129 | + `description` text, | |
130 | + `materiel_administratif` tinyint(1) DEFAULT NULL, | |
131 | + `materiel_technique` tinyint(1) DEFAULT NULL, | |
132 | + `status` varchar(15) DEFAULT 'CREATED', | |
133 | + `date_acquisition` date DEFAULT NULL, | |
134 | + `fournisseur` varchar(50) DEFAULT NULL, | |
135 | + `prix_ht` float unsigned DEFAULT NULL, | |
136 | + `eotp` varchar(45) DEFAULT NULL, | |
137 | + `numero_commande` varchar(45) DEFAULT NULL, | |
138 | + `code_comptable` varchar(45) DEFAULT NULL, | |
139 | + `numero_serie` varchar(45) DEFAULT NULL, | |
140 | + `groupes_thematique_id` int(11) DEFAULT NULL, | |
141 | + `groupes_metier_id` int(11) DEFAULT NULL, | |
142 | + `numero_inventaire_organisme` varchar(45) DEFAULT NULL, | |
143 | + `numero_inventaire_old` varchar(45) DEFAULT NULL COMMENT 'Ancien numero inventaire', | |
144 | + `date_archivage` date DEFAULT NULL, | |
145 | + `etiquette` tinyint(1) DEFAULT '0' COMMENT 'etiquette sur materiel oui ou non', | |
146 | + `lieu_detail` varchar(45) DEFAULT NULL, | |
147 | + `nom_responsable` varchar(45) DEFAULT NULL, | |
148 | + `email_responsable` varchar(45) DEFAULT NULL, | |
149 | + `nom_gestionnaire` VARCHAR(45) NOT NULL, | |
150 | + `nom_createur` varchar(45) DEFAULT NULL COMMENT 'nom du createur de la fiche', | |
151 | + `nom_modificateur` varchar(45) DEFAULT NULL COMMENT 'nom du modificateur de la fiche', | |
152 | + `created` datetime DEFAULT NULL COMMENT 'date et heure de creation de la fiche', | |
153 | + `modified` datetime DEFAULT NULL COMMENT 'date et heure de modif de la fiche', | |
154 | + `date_reception` date DEFAULT NULL, | |
155 | + `organisme_id` int(11) DEFAULT NULL, | |
156 | + `site_id` int(11) DEFAULT '2', | |
157 | + `date_fin_garantie` date DEFAULT NULL, | |
158 | + `duree_garantie` int(10) DEFAULT NULL, | |
159 | + `unite_duree_garantie` varchar (30) DEFAULT NULL, | |
160 | + `photo_id` int(11) DEFAULT NULL, | |
161 | + PRIMARY KEY (`id`), | |
162 | + UNIQUE KEY `numero_irap` (`numero_laboratoire`), | |
163 | + KEY `fk_administrative_materials_sub_categories1` (`sous_categorie_id`), | |
164 | + KEY `fk_materials_thematic_group1` (`groupes_thematique_id`), | |
165 | + KEY `fk_materials_work_group1` (`groupes_metier_id`), | |
166 | + KEY `fk_materiels_categories1` (`categorie_id`), | |
167 | + KEY `fk_materiels_sur_categorie_id` (`sur_categorie_id`), | |
168 | + KEY `fk_materiels_organisme_id` (`organisme_id`), | |
169 | + KEY `fk_materiels_site_id` (`site_id`) | |
170 | +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=11587 ; | |
171 | + | |
172 | + | |
173 | +-- -------------------------------------------------------- | |
174 | +-- | |
175 | +-- Structure de la table `organismes` | |
176 | +-- | |
177 | + | |
178 | +DROP TABLE IF EXISTS `organismes`; | |
179 | +CREATE TABLE IF NOT EXISTS `organismes` ( | |
180 | + `id` int(11) NOT NULL AUTO_INCREMENT, | |
181 | + `nom` varchar(50) DEFAULT NULL, | |
182 | + PRIMARY KEY (`id`) | |
183 | +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ; | |
184 | + | |
185 | + | |
186 | +-- -------------------------------------------------------- | |
187 | +-- | |
188 | +-- Structure de la table `sites` | |
189 | +-- | |
190 | + | |
191 | +DROP TABLE IF EXISTS `sites`; | |
192 | +CREATE TABLE IF NOT EXISTS `sites` ( | |
193 | + `id` int(11) NOT NULL AUTO_INCREMENT, | |
194 | + `nom` varchar(50) DEFAULT NULL, | |
195 | + PRIMARY KEY (`id`) | |
196 | +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ; | |
197 | + | |
198 | + | |
199 | +-- -------------------------------------------------------- | |
200 | +-- | |
201 | +-- Structure de la table `sous_categories` | |
202 | +-- | |
203 | + | |
204 | +DROP TABLE IF EXISTS `sous_categories`; | |
205 | +CREATE TABLE IF NOT EXISTS `sous_categories` ( | |
206 | + `id` int(11) NOT NULL AUTO_INCREMENT, | |
207 | + `nom` varchar(45) NOT NULL, | |
208 | + `categorie_id` int(11) NOT NULL, | |
209 | + PRIMARY KEY (`id`), | |
210 | + KEY `category_id` (`categorie_id`) | |
211 | +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=45 ; | |
212 | + | |
213 | + | |
214 | +-- -------------------------------------------------------- | |
215 | +-- | |
216 | +-- Structure de la table `suivis` | |
217 | +-- | |
218 | + | |
219 | +DROP TABLE IF EXISTS `suivis`; | |
220 | +CREATE TABLE IF NOT EXISTS `suivis` ( | |
221 | + `id` int(11) NOT NULL AUTO_INCREMENT, | |
222 | + `materiel_id` int(11) NOT NULL, | |
223 | + `date_controle` date DEFAULT NULL, | |
224 | + `date_prochain_controle` date DEFAULT NULL, | |
225 | + `type_suivi_id` int(11) DEFAULT NULL, | |
226 | + `organisme` varchar(50) DEFAULT NULL, | |
227 | + `frequence` int(11) DEFAULT NULL, | |
228 | + `type_frequence` varchar(30) DEFAULT NULL, | |
229 | + `commentaire` varchar(100) DEFAULT NULL, | |
230 | + `panne_resolu` tinyint(1) DEFAULT 1, | |
231 | + `groupes_thematique_id` int(11) DEFAULT NULL, | |
232 | + `groupes_metier_id` int(11) DEFAULT NULL, | |
233 | + `statut` varchar(30) DEFAULT 'En cours', | |
234 | + `nom_createur` varchar(45) DEFAULT NULL COMMENT 'nom du createur de la fiche', | |
235 | + `nom_modificateur` varchar(45) DEFAULT NULL COMMENT 'nom du modificateur de la fiche', | |
236 | + `created` datetime DEFAULT NULL COMMENT 'date et heure de creation de la fiche', | |
237 | + `modified` datetime DEFAULT NULL COMMENT 'date et heure de modif de la fiche', | |
238 | + PRIMARY KEY (`id`), | |
239 | + KEY `fk_admi_material_histories_admi_materials1` (`materiel_id`) | |
240 | +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=48 ; | |
241 | + | |
242 | + | |
243 | +-- -------------------------------------------------------- | |
244 | +-- | |
245 | +-- Structure de la table `sur_categories` | |
246 | +-- | |
247 | + | |
248 | +DROP TABLE IF EXISTS `sur_categories`; | |
249 | +CREATE TABLE IF NOT EXISTS `sur_categories` ( | |
250 | + `id` int(11) NOT NULL AUTO_INCREMENT, | |
251 | + `nom` varchar(45) NOT NULL, | |
252 | + PRIMARY KEY (`id`), | |
253 | + UNIQUE KEY `nom_UNIQUE` (`nom`) | |
254 | +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ; | |
255 | + | |
256 | + | |
257 | +-- -------------------------------------------------------- | |
258 | + | |
259 | +-- | |
260 | +-- Structure de la table `type_suivis` | |
261 | +-- | |
262 | + | |
263 | +DROP TABLE IF EXISTS `type_suivis`; | |
264 | +CREATE TABLE IF NOT EXISTS `type_suivis` ( | |
265 | + `id` int(11) NOT NULL AUTO_INCREMENT, | |
266 | + `nom` varchar(50) DEFAULT NULL, | |
267 | + PRIMARY KEY (`id`) | |
268 | +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ; | |
269 | + | |
270 | + | |
271 | +DROP TABLE IF EXISTS `type_documents`; | |
272 | +CREATE TABLE IF NOT EXISTS `type_documents` ( | |
273 | + `id` int(11) NOT NULL AUTO_INCREMENT, | |
274 | + `nom` varchar(100) DEFAULT NULL, | |
275 | + PRIMARY KEY (`id`) | |
276 | +); | |
277 | + | |
278 | +-- -------------------------------------------------------- | |
279 | +-- | |
280 | +-- Structure de la table `users` | |
281 | +-- | |
282 | + | |
283 | +DROP TABLE IF EXISTS `users`; | |
284 | +CREATE TABLE IF NOT EXISTS `users` ( | |
285 | + `id` int(11) NOT NULL AUTO_INCREMENT, | |
286 | + `nom` varchar(45) DEFAULT NULL, | |
287 | + `username` varchar(45) DEFAULT NULL, | |
288 | + `password` VARCHAR(255), | |
289 | + `email` varchar(45) DEFAULT NULL, | |
290 | + `role` varchar(45) DEFAULT NULL, | |
291 | + `groupes_metier_id` int(11) DEFAULT NULL, | |
292 | + `groupe_thematique_id` int(11) DEFAULT NULL, | |
293 | + PRIMARY KEY (`id`), | |
294 | + UNIQUE KEY `username_UNIQUE` (`username`), | |
295 | + KEY `fk_users_groupes_travails1` (`groupes_metier_id`) | |
296 | +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=25 ; | |
297 | + | |
298 | + | |
299 | +-- -------------------------------------------------------- | |
300 | +-- | |
301 | +-- Structure de la table `configurations` | |
302 | +-- | |
303 | + | |
304 | +DROP TABLE IF EXISTS `configurations`; | |
305 | +CREATE TABLE IF NOT EXISTS `configurations` ( | |
306 | + `id` int(11) NOT NULL AUTO_INCREMENT, | |
307 | + `nom` varchar(45) NOT NULL COMMENT 'obligatoire (et unique)', | |
308 | + `mode_install` tinyint(1) DEFAULT NULL, | |
309 | + `mode_debug` tinyint(1) DEFAULT NULL, | |
310 | + `use_ldap` tinyint(1) DEFAULT NULL, | |
311 | + `host_ldap` text DEFAULT NULL, | |
312 | + `port_ldap` varchar(10) DEFAULT NULL, | |
313 | + `authentificationType_ldap` varchar(30) DEFAULT 'xxx', | |
314 | + `baseDn_ldap` varchar(300) DEFAULT null, | |
315 | + `filter_ldap` varchar(30) DEFAULT NULL, | |
316 | + `labName` varchar(200) DEFAULT 'NOM COMPLET', | |
317 | + `labNameShort` varchar(20) DEFAULT NULL, | |
318 | + `labPresent` varchar(10) DEFAULT NULL, | |
319 | + `labUmr` varchar(30) DEFAULT NULL, | |
320 | + `hasPrinter` tinyint(1) DEFAULT NULL, | |
321 | + `nom_groupe_thematique` varchar(50) DEFAULT 'Groupe thematique', | |
322 | + `nom_groupe_metier` varchar(50) DEFAULT 'Groupe metier', | |
323 | + `envoi_mail` tinyint(1) NOT NULL DEFAULT 0, | |
324 | + `sender_mail` varchar(500) DEFAULT 'labinvent@irap.omp.eu', | |
325 | + `emailGuest1` varchar(45) DEFAULT NULL, | |
326 | + `emailGuest2` varchar(45) DEFAULT NULL, | |
327 | + `emailGuest3` varchar(45) DEFAULT NULL, | |
328 | + `emailGuest4` varchar(45) DEFAULT NULL, | |
329 | + `emailGuest5` varchar(45) DEFAULT NULL, | |
330 | + `emailGuest6` varchar(45) DEFAULT NULL, | |
331 | + `emailGuest7` varchar(45) DEFAULT NULL, | |
332 | + `emailGuest8` varchar(45) DEFAULT NULL, | |
333 | + `emailGuest9` varchar(45) DEFAULT NULL, | |
334 | + `emailGuest10` varchar(45) DEFAULT NULL, | |
335 | + `test` tinyint(1) DEFAULT NULL, | |
336 | + `prix_inventaire_administratif` int( 10 ) DEFAULT '800', | |
337 | + `numero_labo_sans_annee` tinyint(1) DEFAULT NULL, | |
338 | + `date_commande_facultative` tinyint(1) DEFAULT NULL, | |
339 | + `taille_max_doc` int (15) DEFAULT '8000000', | |
340 | + `aff_par_defaut` smallint(6) NOT NULL DEFAULT 20, | |
341 | + PRIMARY KEY (`id`), | |
342 | + UNIQUE KEY `nom_UNIQUE` (`nom`) | |
343 | +); | |
344 | + | |
345 | +-- | |
346 | +-- Contraintes pour les tables exportées | |
347 | +-- | |
348 | + | |
349 | +-- | |
350 | +-- Contraintes pour la table `categories` | |
351 | +-- | |
352 | +ALTER TABLE `categories` | |
353 | + ADD CONSTRAINT `fk_sur_categorie_id` FOREIGN KEY (`sur_categorie_id`) REFERENCES `sur_categories` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; | |
354 | + | |
355 | +-- | |
356 | +-- Contraintes pour la table `documents` | |
357 | +-- | |
358 | +ALTER TABLE `documents` | |
359 | + ADD CONSTRAINT `fk_documents_materiel_id` FOREIGN KEY (`materiel_id`) REFERENCES `materiels` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, | |
360 | + ADD CONSTRAINT `fk_documents_suivi_id` FOREIGN KEY (`suivi_id`) REFERENCES `suivis` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; | |
361 | + | |
362 | +-- | |
363 | +-- Contraintes pour la table `emprunts` | |
364 | +-- | |
365 | +ALTER TABLE `emprunts` | |
366 | + ADD CONSTRAINT `fk_technical_materials_internal_loans_copy1_admi_materials1` FOREIGN KEY (`materiel_id`) REFERENCES `materiels` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, | |
367 | + ADD CONSTRAINT `fk_emprunts_site_id` FOREIGN KEY (`site_id`) REFERENCES `sites` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; | |
368 | + | |
369 | +-- | |
370 | +-- Contraintes pour la table `materiels` | |
371 | +-- | |
372 | +ALTER TABLE `materiels` | |
373 | + ADD CONSTRAINT `fk_administrative_materials_sub_categories1` FOREIGN KEY (`sous_categorie_id`) REFERENCES `sous_categories` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, | |
374 | + ADD CONSTRAINT `fk_materials_thematic_group1` FOREIGN KEY (`groupes_thematique_id`) REFERENCES `groupes_thematiques` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, | |
375 | + ADD CONSTRAINT `fk_materials_work_group1` FOREIGN KEY (`groupes_metier_id`) REFERENCES `groupes_metiers` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, | |
376 | + ADD CONSTRAINT `fk_materiels_categories1` FOREIGN KEY (`categorie_id`) REFERENCES `categories` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, | |
377 | + ADD CONSTRAINT `fk_materiels_organisme_id` FOREIGN KEY (`organisme_id`) REFERENCES `organismes` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, | |
378 | + ADD CONSTRAINT `fk_materiels_site_id` FOREIGN KEY (`site_id`) REFERENCES `sites` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, | |
379 | + ADD CONSTRAINT `fk_materiels_sur_categorie_id` FOREIGN KEY (`sur_categorie_id`) REFERENCES `sur_categories` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; | |
380 | + | |
381 | +-- | |
382 | +-- Contraintes pour la table `sous_categories` | |
383 | +-- | |
384 | +ALTER TABLE `sous_categories` | |
385 | + ADD CONSTRAINT `category_id` FOREIGN KEY (`categorie_id`) REFERENCES `categories` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; | |
386 | + | |
387 | +-- | |
388 | +-- Contraintes pour la table `suivis` | |
389 | +-- | |
390 | +ALTER TABLE `suivis` | |
391 | + ADD CONSTRAINT `fk_admi_material_histories_admi_materials1` FOREIGN KEY (`materiel_id`) REFERENCES `materiels` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, | |
392 | + ADD CONSTRAINT `fk_suivis_type_suivi_id` FOREIGN KEY (`type_suivi_id`) REFERENCES `type_suivis` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; | |
393 | + | |
394 | +ALTER TABLE `suivis` ADD CONSTRAINT `fk_suivis_groupe_thematique` FOREIGN KEY (`groupes_thematique_id`) REFERENCES `groupes_thematiques` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; | |
395 | +ALTER TABLE `suivis` ADD CONSTRAINT `fk_suivis_groupe_metier` FOREIGN KEY (`groupes_metier_id`) REFERENCES `groupes_metiers` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; | |
396 | + | |
397 | + | |
398 | +ALTER TABLE `documents` | |
399 | + ADD CONSTRAINT `fk_documents_type_documents_id` FOREIGN KEY (`type_document_id`) REFERENCES `type_documents` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; | |
400 | +-- | |
401 | +-- Contraintes pour la table `users` | |
402 | +-- | |
403 | +ALTER TABLE `users` | |
404 | + ADD CONSTRAINT `fk_users_groupes_travails1` FOREIGN KEY (`groupes_metier_id`) REFERENCES `groupes_metiers` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, | |
405 | + ADD CONSTRAINT `fk_users_groupe_thematique_id` FOREIGN KEY (`groupe_thematique_id`) REFERENCES `groupes_thematiques` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; | |
406 | + | |
407 | +-- Insertion par défaut | |
408 | +Insert into type_suivis(nom) values ('Réparation'); | |
409 | +Insert into sites(id, nom) values (9, 'N/A'); | |
410 | + | |
411 | +Insert into type_documents(id, nom) values (1, 'N/A'); | |
412 | +Insert into type_documents(nom) values ('Bon de commande'); | |
413 | +Insert into type_documents(nom) values ('Bon de livraison'); | |
414 | +Insert into type_documents(nom) values ('Photo'); | |
415 | +Insert into type_documents(nom) values ('Documentation technique'); | |
416 | +Insert into type_documents(nom) values ('Spécifications'); | |
417 | +Insert into type_documents(nom) values ('CR de maintenance'); | |
418 | +Insert into type_documents(nom) values ('CR d\'étalonnage'); | |
419 | +Insert into type_documents(nom) values ('Suivi de panne'); | |
420 | +Insert into type_documents(nom) values ('Certificat de garantie'); | |
421 | +Insert into type_documents(nom) values ('Certificat de conformité'); | |
422 | +Insert into type_documents(nom) values ('Manuel d\'utilisation'); | |
423 | + | |
424 | +-- Insertion par défaut pour la table configuration | |
425 | +Insert into `configurations`(`nom`, `mode_install`, `mode_debug`, `use_ldap`, `host_ldap`, `port_ldap`, `authentificationType_ldap`, `baseDn_ldap`, `filter_ldap`, `labName`, `labNameShort`, `labPresent`, `labUmr`, `hasPrinter`, `emailGuest1`, `emailGuest2`, `emailGuest3`) | |
426 | +values ('default', '1', '0', '0', '', '', 'xxx', '', '', 'LABONAME', 'LABO', 'du ', '', '0', '', '', ''); | |
427 | + | |
428 | + | |
429 | + | |
430 | +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; | |
431 | +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; | |
432 | +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; | ... | ... |