-
Notifications
You must be signed in to change notification settings - Fork 0
/
refugeesassistance.sql
126 lines (101 loc) · 3.85 KB
/
refugeesassistance.sql
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
-- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Client : 127.0.0.1
-- Généré le : Ven 02 Décembre 2016 à 02:06
-- Version du serveur : 5.6.17
-- Version de PHP : 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!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 */;
--
-- Base de données : `refugeesassistance`
--
-- --------------------------------------------------------
--
-- Structure de la table `actualites`
--
CREATE TABLE IF NOT EXISTS `actualites` (
`titre` varchar(25) NOT NULL,
`createur` varchar(25) NOT NULL,
`id_zone` varchar(25) NOT NULL,
`id_categorie` varchar(25) NOT NULL,
PRIMARY KEY (`id_zone`,`id_categorie`),
KEY `id_categorie` (`id_categorie`),
KEY `createur` (`createur`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Structure de la table `categorie`
--
CREATE TABLE IF NOT EXISTS `categorie` (
`libelle` varchar(25) NOT NULL,
`id_categorie` varchar(25) NOT NULL,
PRIMARY KEY (`id_categorie`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Structure de la table `demande`
--
CREATE TABLE IF NOT EXISTS `demande` (
`id_ville` varchar(25) NOT NULL,
`id_categorie` varchar(25) NOT NULL,
`libelle` varchar(25) NOT NULL,
PRIMARY KEY (`id_ville`,`id_categorie`),
UNIQUE KEY `id_ville` (`id_ville`),
KEY `id_ville_2` (`id_ville`,`id_categorie`),
KEY `id_categorie` (`id_categorie`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Structure de la table `inscrit`
--
CREATE TABLE IF NOT EXISTS `inscrit` (
`nom` varchar(25) NOT NULL,
`login` varchar(25) NOT NULL,
`mdp` varchar(25) NOT NULL,
`mail` varchar(35) NOT NULL,
`role` enum('ROLE_ADMINISTRATEUR','ROLE_ORGANISATEUR','','') NOT NULL DEFAULT 'ROLE_ORGANISATEUR',
`acces_region` varchar(200) NOT NULL,
PRIMARY KEY (`login`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Contenu de la table `inscrit`
--
INSERT INTO `inscrit` (`nom`, `login`, `mdp`, `mail`, `role`, `acces_region`) VALUES
('Jourdan', 'nicolas', 'Salut07salut', 'nicolas.jourdan.c@gmail.com', 'ROLE_ORGANISATEUR', 'TEST'),
('Jourdan', 'nicolasfg', 'Salut07salut', 'nicolas.jourdan.c@gmail.com', 'ROLE_ORGANISATEUR', 'TEST');
-- --------------------------------------------------------
--
-- Structure de la table `zone`
--
CREATE TABLE IF NOT EXISTS `zone` (
`nom_ville` varchar(25) NOT NULL,
`departement` varchar(25) NOT NULL,
`id_ville` varchar(25) NOT NULL,
`region` varchar(25) NOT NULL,
PRIMARY KEY (`id_ville`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Contraintes pour les tables exportées
--
--
-- Contraintes pour la table `actualites`
--
ALTER TABLE `actualites`
ADD CONSTRAINT `actualites_ibfk_3` FOREIGN KEY (`createur`) REFERENCES `inscrit` (`login`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `actualites_ibfk_1` FOREIGN KEY (`id_zone`) REFERENCES `zone` (`id_ville`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `actualites_ibfk_2` FOREIGN KEY (`id_categorie`) REFERENCES `categorie` (`id_categorie`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Contraintes pour la table `demande`
--
ALTER TABLE `demande`
ADD CONSTRAINT `demande_ibfk_2` FOREIGN KEY (`id_categorie`) REFERENCES `categorie` (`id_categorie`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `demande_ibfk_1` FOREIGN KEY (`id_ville`) REFERENCES `zone` (`id_ville`) ON DELETE CASCADE ON UPDATE CASCADE;
/*!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 */;