-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathequiposdb.sql
151 lines (123 loc) · 3.6 KB
/
equiposdb.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
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
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Servidor: localhost
-- Tiempo de generación: 30-04-2018 a las 14:26:03
-- Versión del servidor: 10.1.21-MariaDB
-- Versión de PHP: 5.6.30
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 utf8mb4 */;
--
-- Base de datos: `equiposdb`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `device`
--
CREATE TABLE `device` (
`device_id` int(10) NOT NULL,
`device_mac` varchar(17) NOT NULL,
`device_type` varchar(50) NOT NULL,
`user_id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `device`
--
INSERT INTO `device` (`device_id`, `device_mac`, `device_type`, `user_id`) VALUES
(2, 'Didjdjdu', 'Movil', 7),
(3, 'Jggjhg', 'Table', 7),
(4, 'd4:6e:0e:07:8f:e0', 'Laptop', 7),
(5, 'oingudfjosfdoj', 'Movil', 8);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `roll`
--
CREATE TABLE `roll` (
`user_roll_id` int(10) NOT NULL,
`roll_name` varchar(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `roll`
--
INSERT INTO `roll` (`user_roll_id`, `roll_name`) VALUES
(5, 'no_docent'),
(6, 'student'),
(7, 'docent'),
(8, 'admin');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `user`
--
CREATE TABLE `user` (
`user_id` int(11) NOT NULL,
`user_name` varchar(50) NOT NULL,
`user_email` varchar(50) NOT NULL,
`user_password` varchar(50) NOT NULL,
`user_roll_id` int(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `user`
--
INSERT INTO `user` (`user_id`, `user_name`, `user_email`, `user_password`, `user_roll_id`) VALUES
(6, 'Lineyis Hechavarria', '[email protected]', '827ccb0eea8a706c4c34a16891f84e7b', 5),
(7, 'Enrique Isalgue', '[email protected]', '827ccb0eea8a706c4c34a16891f84e7b', 6),
(8, 'Reinier Isalgue', '[email protected]', '827ccb0eea8a706c4c34a16891f84e7b', 8);
--
-- Índices para tablas volcadas
--
--
-- Indices de la tabla `device`
--
ALTER TABLE `device`
ADD PRIMARY KEY (`device_id`),
ADD KEY `user_id` (`user_id`);
--
-- Indices de la tabla `roll`
--
ALTER TABLE `roll`
ADD PRIMARY KEY (`user_roll_id`);
--
-- Indices de la tabla `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`user_id`),
ADD KEY `user_roll_id` (`user_roll_id`);
--
-- AUTO_INCREMENT de las tablas volcadas
--
--
-- AUTO_INCREMENT de la tabla `device`
--
ALTER TABLE `device`
MODIFY `device_id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT de la tabla `roll`
--
ALTER TABLE `roll`
MODIFY `user_roll_id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT de la tabla `user`
--
ALTER TABLE `user`
MODIFY `user_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- Restricciones para tablas volcadas
--
--
-- Filtros para la tabla `device`
--
ALTER TABLE `device`
ADD CONSTRAINT `user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`user_id`);
--
-- Filtros para la tabla `user`
--
ALTER TABLE `user`
ADD CONSTRAINT `user_roll_id` FOREIGN KEY (`user_roll_id`) REFERENCES `roll` (`user_roll_id`);
/*!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 */;