· 9 years ago · May 05, 2017, 03:04 PM
1-- phpMyAdmin SQL Dump
2-- version 4.7.0
3-- https://www.phpmyadmin.net/
4--
5-- Hôte : sigyn-db.cdvjopbzfq6j.eu-west-1.rds.amazonaws.com
6-- Généré le : ven. 05 mai 2017 à 13:16
7-- Version du serveur : 5.6.27-log
8-- Version de PHP : 7.0.16
9
10SET NAMES utf8;
11SET time_zone = '+00:00';
12SET foreign_key_checks = 0;
13SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
14
15
16/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
17/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
18/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
19/*!40101 SET NAMES utf8mb4 */;
20
21--
22-- Base de données : `sigyn`
23--
24CREATE DATABASE IF NOT EXISTS `sigyn`;
25USE `sigyn`;
26
27-- --------------------------------------------------------
28
29--
30-- Structure de la table `Messages`
31--
32
33CREATE TABLE `Messages` (
34 `id` int(10) UNSIGNED NOT NULL,
35 `id_pro` int(10) UNSIGNED NOT NULL,
36 `id_patient` int(10) UNSIGNED NOT NULL,
37 `text` text NOT NULL,
38 `is_pro` tinyint(1) NOT NULL,
39 `date` timestamp NOT NULL
40) ENGINE=InnoDB DEFAULT CHARSET=latin1;
41
42--
43-- Déchargement des données de la table `Messages`
44--
45
46INSERT INTO `Messages` (`id`, `id_pro`, `id_patient`, `text`, `is_pro`, `date`) VALUES
47(82, 24, 7, 'Salut Bob, Ca gaze ?', 1, '2017-04-27 00:00:00');
48
49-- --------------------------------------------------------
50
51--
52-- Structure de la table `Patients`
53--
54
55CREATE TABLE `Patients` (
56 `id` int(10) UNSIGNED NOT NULL,
57 `email` varchar(255) NOT NULL,
58 `name` varchar(255) NOT NULL,
59 `firstname` varchar(255) NOT NULL,
60 `password` varchar(255) DEFAULT NULL,
61 `pro_id` int(10) UNSIGNED NOT NULL
62) ENGINE=InnoDB DEFAULT CHARSET=latin1;
63
64--
65-- Déchargement des données de la table `Patients`
66--
67
68INSERT INTO `Patients` (`id`, `email`, `name`, `firstname`, `password`, `pro_id`) VALUES
69(1, 'qc.cloarec@gmail.com', 'Cloarec', 'Quentin', NULL, 12),
70(5, 'pata97400@gmail.com', 'Le Corre', 'Thomas', '$2y$08$cFY4WG54RkpDeW5qNmZpT.R9GVJ7qIvgDSnStTgWqkFOf2R6YCOSO', 23),
71(6, 'spamqcloarec@gmail.com', 'Galoge', 'Grospd', NULL, 24),
72(7, 'bobleponge@bob.com', 'Leponge', 'Bob', NULL, 24),
73(8, 'jeanmich@patient.fr', 'Patient', 'Jean-Michel', NULL, 23);
74
75-- --------------------------------------------------------
76
77--
78-- Structure de la table `Pros`
79--
80
81CREATE TABLE `Pros` (
82 `id` int(10) UNSIGNED NOT NULL,
83 `email` varchar(255) DEFAULT NULL,
84 `password` varchar(255) DEFAULT NULL,
85 `pro_type` enum('generalist','dentist','nutritionnist','') NOT NULL DEFAULT 'generalist',
86 `confirmed` tinyint(1) NOT NULL DEFAULT '0'
87) ENGINE=InnoDB DEFAULT CHARSET=utf8;
88
89--
90-- Déchargement des données de la table `Pros`
91--
92
93INSERT INTO `Pros` (`id`, `email`, `password`, `pro_type`, `confirmed`) VALUES
94(2, 'test@test.com', '$2y$08$emtPc2JSMWNzZTBFalN5cOosJqt0hLh.UcEfiWAtZRvariFbUFSUO', 'generalist', 0),
95(3, 'testiphone@tot.com', '$2y$08$MVNNd0haSFdRRTJ5a3EzLuegNpYHcUetUtC6bCAiNWc2iiv85k3XK', 'generalist', 0),
96(12, 'toto@toto.com', '$2y$08$djExSFZLbTdzdW91UEY2dOuLFMgDQZTIbcBYjkeOtLforAJ7Zu8KK', 'generalist', 0),
97(19, 'test@test.com', '$2y$08$SU5HZU5YbnJmZmUxZVBveO2jFaBSyA6RO9O3qyH4zY0yA4AoZiKmq', 'generalist', 0),
98(20, 'galogepd@grospd.com', '$2y$08$aWVKSVF6SnhoVW9oTDBDTutzmiTfITzvGZK2iRlzCcdrqIvTyNyni', 'generalist', 0),
99(21, 'johndoe@gmail.com', '$2y$08$bS9rN3BhaXBhWVRsZm9OYunnUAtSr4WS8fplchcNeLdXTOaWiRwTK', 'generalist', 0),
100(23, 'pata97400@gmail.com', '$2y$08$d21yUUl4Qy9JUEcxUUNqO.ZL..trXX/qVxAkY55hLRyr37571B1Z.', 'dentist', 1),
101(24, 'qc.cloarec@gmail.com', '$2y$08$a1czRkRGMHVWVk5aTkRSVOiWrYcJ7huft5A6R00UFAUbVVhR2Q3sy', 'nutritionnist', 1);
102
103-- --------------------------------------------------------
104
105--
106-- Structure de la table `Recovery_Token`
107--
108
109CREATE TABLE `Recovery_Token` (
110 `id` varchar(32) NOT NULL DEFAULT '',
111 `expiration_date` int(11) DEFAULT NULL,
112 `pro_id` int(10) UNSIGNED NOT NULL
113) ENGINE=InnoDB DEFAULT CHARSET=utf8;
114
115--
116-- Index pour les tables déchargées
117--
118
119--
120-- Index pour la table `Messages`
121--
122ALTER TABLE `Messages`
123 ADD PRIMARY KEY (`id`),
124 ADD KEY `id_patient` (`id_patient`),
125 ADD KEY `id_pro` (`id_pro`);
126
127--
128-- Index pour la table `Patients`
129--
130ALTER TABLE `Patients`
131 ADD PRIMARY KEY (`id`),
132 ADD KEY `pro_id` (`pro_id`);
133
134--
135-- Index pour la table `Pros`
136--
137ALTER TABLE `Pros`
138 ADD PRIMARY KEY (`id`);
139
140--
141-- Index pour la table `Recovery_Token`
142--
143ALTER TABLE `Recovery_Token`
144 ADD PRIMARY KEY (`id`),
145 ADD UNIQUE KEY `id` (`id`),
146 ADD KEY `user_id` (`pro_id`);
147
148--
149-- AUTO_INCREMENT pour les tables déchargées
150--
151
152--
153-- AUTO_INCREMENT pour la table `Messages`
154--
155ALTER TABLE `Messages`
156 MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=83;
157--
158-- AUTO_INCREMENT pour la table `Patients`
159--
160ALTER TABLE `Patients`
161 MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
162--
163-- AUTO_INCREMENT pour la table `Pros`
164--
165ALTER TABLE `Pros`
166 MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25;
167--
168-- Contraintes pour les tables déchargées
169--
170
171--
172-- Contraintes pour la table `Messages`
173--
174ALTER TABLE `Messages`
175 ADD CONSTRAINT `Messages_ibfk_1` FOREIGN KEY (`id_patient`) REFERENCES `Patients` (`id`),
176 ADD CONSTRAINT `Messages_ibfk_2` FOREIGN KEY (`id_pro`) REFERENCES `Pros` (`id`);
177
178--
179-- Contraintes pour la table `Patients`
180--
181ALTER TABLE `Patients`
182 ADD CONSTRAINT `Patients_ibfk_1` FOREIGN KEY (`pro_id`) REFERENCES `Pros` (`id`);
183
184--
185-- Contraintes pour la table `Recovery_Token`
186--
187ALTER TABLE `Recovery_Token`
188 ADD CONSTRAINT `Recovery_Token_ibfk_1` FOREIGN KEY (`pro_id`) REFERENCES `Pros` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
189COMMIT;
190
191/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
192/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
193/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;