Skip to content

Commit 6637deb

Browse files
committed
v1.0
1 parent d42e732 commit 6637deb

File tree

1 file changed

+389
-0
lines changed

1 file changed

+389
-0
lines changed

DATABASE_restaurant.sql

Lines changed: 389 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,389 @@
1+
-- phpMyAdmin SQL Dump
2+
-- version 4.8.5
3+
-- https://www.phpmyadmin.net/
4+
--
5+
-- Servidor: 127.0.0.1
6+
-- Tiempo de generación: 21-01-2022 a las 15:55:27
7+
-- Versión del servidor: 10.1.38-MariaDB
8+
-- Versión de PHP: 7.3.2
9+
10+
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
11+
SET AUTOCOMMIT = 0;
12+
START TRANSACTION;
13+
SET time_zone = "+00:00";
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 datos: `restaurant_orders`
23+
--
24+
25+
-- --------------------------------------------------------
26+
27+
--
28+
-- Estructura de tabla para la tabla `categories`
29+
--
30+
31+
CREATE TABLE `categories` (
32+
`id` bigint(20) UNSIGNED NOT NULL,
33+
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
34+
`description` longtext COLLATE utf8mb4_unicode_ci,
35+
`created_at` timestamp NULL DEFAULT NULL,
36+
`updated_at` timestamp NULL DEFAULT NULL
37+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
38+
39+
--
40+
-- Volcado de datos para la tabla `categories`
41+
--
42+
43+
INSERT INTO `categories` (`id`, `name`, `description`, `created_at`, `updated_at`) VALUES
44+
(1, 'Bebidas', 'Bebidas de todo tipo', '2021-10-26 16:01:24', '2021-10-29 14:16:40'),
45+
(2, 'Primeros Platos', 'Platos entrantes y ensaladas', '2021-10-26 16:01:39', '2021-10-29 14:16:14'),
46+
(3, 'Segundos Platos', 'Pescados y carnes', '2021-10-26 16:01:47', '2021-10-29 14:16:29'),
47+
(5, 'Postres', 'Dulces y frutas frescas', '2021-10-27 07:15:28', '2021-10-27 07:15:28'),
48+
(6, 'Combos', 'Combos', '2021-10-29 20:11:11', '2021-10-29 21:43:50');
49+
50+
-- --------------------------------------------------------
51+
52+
--
53+
-- Estructura de tabla para la tabla `clients`
54+
--
55+
56+
CREATE TABLE `clients` (
57+
`id` bigint(20) UNSIGNED NOT NULL,
58+
`id_order` bigint(20) UNSIGNED NOT NULL,
59+
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
60+
`notes` longtext COLLATE utf8mb4_unicode_ci,
61+
`created_at` timestamp NULL DEFAULT NULL,
62+
`updated_at` timestamp NULL DEFAULT NULL
63+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
64+
65+
--
66+
-- Volcado de datos para la tabla `clients`
67+
--
68+
69+
INSERT INTO `clients` (`id`, `id_order`, `name`, `notes`, `created_at`, `updated_at`) VALUES
70+
(1, 1, 'Javier', 'Ensalada sin cebolla.', NULL, NULL),
71+
(2, 8, 'Federico', 'Hamburguesa poco hecha.', NULL, NULL),
72+
(3, 12, 'Sergio', NULL, NULL, NULL),
73+
(4, 12, 'Sergio', NULL, NULL, NULL),
74+
(5, 18, 'Marta', NULL, NULL, NULL);
75+
76+
-- --------------------------------------------------------
77+
78+
--
79+
-- Estructura de tabla para la tabla `failed_jobs`
80+
--
81+
82+
CREATE TABLE `failed_jobs` (
83+
`id` bigint(20) UNSIGNED NOT NULL,
84+
`uuid` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
85+
`connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
86+
`queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
87+
`payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
88+
`exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
89+
`failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
90+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
91+
92+
-- --------------------------------------------------------
93+
94+
--
95+
-- Estructura de tabla para la tabla `migrations`
96+
--
97+
98+
CREATE TABLE `migrations` (
99+
`id` int(10) UNSIGNED NOT NULL,
100+
`migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
101+
`batch` int(11) NOT NULL
102+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
103+
104+
--
105+
-- Volcado de datos para la tabla `migrations`
106+
--
107+
108+
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
109+
(1, '2014_10_12_000000_create_users_table', 1),
110+
(2, '2014_10_12_100000_create_password_resets_table', 1),
111+
(3, '2019_08_19_000000_create_failed_jobs_table', 1),
112+
(4, '2019_12_14_000001_create_personal_access_tokens_table', 1),
113+
(5, '2021_10_26_164220_create_categories_table', 1),
114+
(6, '2021_10_26_175345_create_products_table', 1),
115+
(7, '2021_10_26_194055_create_clients_table', 1),
116+
(8, '2021_10_27_000115_create_orders_table', 1);
117+
118+
-- --------------------------------------------------------
119+
120+
--
121+
-- Estructura de tabla para la tabla `orders`
122+
--
123+
124+
CREATE TABLE `orders` (
125+
`id` bigint(20) UNSIGNED NOT NULL,
126+
`id_order` bigint(20) UNSIGNED NOT NULL,
127+
`id_client` bigint(20) UNSIGNED NOT NULL,
128+
`id_product` bigint(20) UNSIGNED NOT NULL,
129+
`quantity` bigint(20) UNSIGNED NOT NULL,
130+
`status` bigint(20) UNSIGNED NOT NULL,
131+
`created_at` timestamp NULL DEFAULT NULL,
132+
`updated_at` timestamp NULL DEFAULT NULL
133+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
134+
135+
--
136+
-- Volcado de datos para la tabla `orders`
137+
--
138+
139+
INSERT INTO `orders` (`id`, `id_order`, `id_client`, `id_product`, `quantity`, `status`, `created_at`, `updated_at`) VALUES
140+
(1, 1, 1, 2, 2, 0, '2021-11-26 20:18:02', '2021-11-26 20:18:02'),
141+
(2, 1, 1, 5, 1, 0, '2021-11-26 20:18:02', '2021-11-26 20:18:02'),
142+
(3, 1, 1, 9, 1, 0, '2021-11-26 20:18:02', '2021-11-26 20:18:02'),
143+
(4, 1, 1, 10, 1, 0, '2021-11-26 20:18:02', '2021-11-26 20:18:02'),
144+
(5, 1, 1, 11, 1, 0, '2021-11-26 20:18:02', '2021-11-26 20:18:02'),
145+
(6, 1, 1, 12, 1, 0, '2021-11-26 20:18:02', '2021-11-26 20:18:02'),
146+
(7, 1, 1, 4, 1, 0, '2021-11-26 20:18:02', '2021-11-26 20:18:02'),
147+
(8, 8, 2, 6, 2, 2, '2021-11-26 20:19:30', '2021-11-26 20:19:30'),
148+
(9, 8, 2, 10, 2, 2, '2021-11-26 20:19:30', '2021-11-26 20:19:30'),
149+
(10, 8, 2, 11, 1, 2, '2021-11-26 20:19:30', '2021-11-26 20:19:30'),
150+
(11, 8, 2, 13, 1, 2, '2021-11-26 20:19:30', '2021-11-26 20:19:30'),
151+
(15, 12, 4, 9, 2, 0, '2021-11-26 23:41:31', '2021-11-26 23:41:31'),
152+
(16, 12, 4, 12, 1, 0, '2021-11-26 23:41:31', '2021-11-26 23:41:31'),
153+
(17, 12, 4, 4, 1, 0, '2021-11-26 23:41:31', '2021-11-26 23:41:31'),
154+
(18, 18, 5, 5, 2, 0, '2021-11-26 23:46:09', '2021-11-26 23:46:09'),
155+
(19, 18, 5, 11, 1, 0, '2021-11-26 23:46:09', '2021-11-26 23:46:09'),
156+
(20, 18, 5, 14, 1, 0, '2021-11-26 23:46:10', '2021-11-26 23:46:10');
157+
158+
-- --------------------------------------------------------
159+
160+
--
161+
-- Estructura de tabla para la tabla `password_resets`
162+
--
163+
164+
CREATE TABLE `password_resets` (
165+
`email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
166+
`token` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
167+
`created_at` timestamp NULL DEFAULT NULL
168+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
169+
170+
-- --------------------------------------------------------
171+
172+
--
173+
-- Estructura de tabla para la tabla `personal_access_tokens`
174+
--
175+
176+
CREATE TABLE `personal_access_tokens` (
177+
`id` bigint(20) UNSIGNED NOT NULL,
178+
`tokenable_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
179+
`tokenable_id` bigint(20) UNSIGNED NOT NULL,
180+
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
181+
`token` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,
182+
`abilities` text COLLATE utf8mb4_unicode_ci,
183+
`last_used_at` timestamp NULL DEFAULT NULL,
184+
`created_at` timestamp NULL DEFAULT NULL,
185+
`updated_at` timestamp NULL DEFAULT NULL
186+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
187+
188+
-- --------------------------------------------------------
189+
190+
--
191+
-- Estructura de tabla para la tabla `products`
192+
--
193+
194+
CREATE TABLE `products` (
195+
`id` bigint(20) UNSIGNED NOT NULL,
196+
`id_category` bigint(20) UNSIGNED NOT NULL,
197+
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
198+
`description` longtext COLLATE utf8mb4_unicode_ci,
199+
`price` decimal(15,2) NOT NULL,
200+
`stock` tinyint(1) NOT NULL DEFAULT '1',
201+
`created_at` timestamp NULL DEFAULT NULL,
202+
`updated_at` timestamp NULL DEFAULT NULL
203+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
204+
205+
--
206+
-- Volcado de datos para la tabla `products`
207+
--
208+
209+
INSERT INTO `products` (`id`, `id_category`, `name`, `description`, `price`, `stock`, `created_at`, `updated_at`) VALUES
210+
(2, 1, 'Coca Cola', NULL, '2.00', 1, '2021-10-26 16:09:41', '2021-10-27 09:18:59'),
211+
(4, 5, 'Flan', NULL, '5.00', 1, '2021-10-27 09:24:49', '2021-10-27 09:24:49'),
212+
(5, 1, 'Agua', NULL, '1.00', 1, '2021-10-27 18:40:54', '2021-10-27 18:40:54'),
213+
(6, 1, 'Cerveza', NULL, '2.00', 1, '2021-10-27 18:41:08', '2021-10-27 18:41:08'),
214+
(7, 1, 'Vino', NULL, '2.00', 1, '2021-10-27 18:41:21', '2021-10-27 18:41:21'),
215+
(8, 2, 'Filete y patatas', NULL, '15.00', 0, '2021-10-27 18:41:56', '2021-10-29 12:45:08'),
216+
(9, 2, 'Ensalada y tomates', NULL, '10.00', 1, '2021-10-27 18:42:22', '2021-10-27 18:42:22'),
217+
(10, 2, 'Patata asada', NULL, '5.00', 1, '2021-10-27 18:42:40', '2021-10-27 18:42:40'),
218+
(11, 3, 'Hamburguesa', NULL, '8.00', 1, '2021-10-27 18:42:59', '2021-10-27 18:42:59'),
219+
(12, 3, 'Pollo asado', NULL, '7.00', 1, '2021-10-27 18:43:17', '2021-10-27 18:43:17'),
220+
(13, 5, 'Platano', NULL, '2.00', 1, '2021-10-27 18:43:36', '2021-10-27 18:43:36'),
221+
(14, 6, 'Combo 1', NULL, '5.00', 1, '2021-10-29 20:12:00', '2021-10-29 20:12:00');
222+
223+
-- --------------------------------------------------------
224+
225+
--
226+
-- Estructura de tabla para la tabla `users`
227+
--
228+
229+
CREATE TABLE `users` (
230+
`id` bigint(20) UNSIGNED NOT NULL,
231+
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
232+
`email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
233+
`active` tinyint(1) DEFAULT '0',
234+
`role` int(11) NOT NULL DEFAULT '10',
235+
`email_verified_at` timestamp NULL DEFAULT NULL,
236+
`password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
237+
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
238+
`created_at` timestamp NULL DEFAULT NULL,
239+
`updated_at` timestamp NULL DEFAULT NULL
240+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
241+
242+
--
243+
-- Volcado de datos para la tabla `users`
244+
--
245+
246+
INSERT INTO `users` (`id`, `name`, `email`, `active`, `role`, `email_verified_at`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES
247+
(1, 'Administrador', '[email protected]', 1, 0, NULL, '$2y$10$qIB9496fj6yYqMs1xbkiKOXQyIRytoO9RhgmlqFw/lpBpJ24xJlwC', NULL, '2021-10-31 16:26:36', '2021-10-31 16:26:36'),
248+
(2, 'Camarero José', '[email protected]', 1, 1, NULL, '$2y$10$Hfiy203.aBvcix6yk2T1Ue5fPD2JO2X63uaOSwn57ycOH2KJCD76q', NULL, '2021-11-26 19:37:30', '2021-11-26 19:49:01'),
249+
(3, 'Camarero Toni', '[email protected]', 1, 1, NULL, '$2y$10$GJWCfWspM37Uti1Y.M6L3uYX0AsDX0nrU.RqZbWxnx.CcVDm4cViG', NULL, '2021-11-26 19:37:42', '2021-11-26 23:35:14'),
250+
(4, 'Cocinero Iván', '[email protected]', 1, 2, NULL, '$2y$10$CZpdsN6/RcZyh2VVjfhlcOvCekyKvbGulKTJgyDpCmY/TKiu3LDE2', NULL, '2021-11-26 19:38:09', '2021-11-26 19:49:20');
251+
252+
--
253+
-- Índices para tablas volcadas
254+
--
255+
256+
--
257+
-- Indices de la tabla `categories`
258+
--
259+
ALTER TABLE `categories`
260+
ADD PRIMARY KEY (`id`);
261+
262+
--
263+
-- Indices de la tabla `clients`
264+
--
265+
ALTER TABLE `clients`
266+
ADD PRIMARY KEY (`id`);
267+
268+
--
269+
-- Indices de la tabla `failed_jobs`
270+
--
271+
ALTER TABLE `failed_jobs`
272+
ADD PRIMARY KEY (`id`),
273+
ADD UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`);
274+
275+
--
276+
-- Indices de la tabla `migrations`
277+
--
278+
ALTER TABLE `migrations`
279+
ADD PRIMARY KEY (`id`);
280+
281+
--
282+
-- Indices de la tabla `orders`
283+
--
284+
ALTER TABLE `orders`
285+
ADD PRIMARY KEY (`id`),
286+
ADD KEY `orders_id_client_foreign` (`id_client`),
287+
ADD KEY `orders_id_product_foreign` (`id_product`);
288+
289+
--
290+
-- Indices de la tabla `password_resets`
291+
--
292+
ALTER TABLE `password_resets`
293+
ADD KEY `password_resets_email_index` (`email`);
294+
295+
--
296+
-- Indices de la tabla `personal_access_tokens`
297+
--
298+
ALTER TABLE `personal_access_tokens`
299+
ADD PRIMARY KEY (`id`),
300+
ADD UNIQUE KEY `personal_access_tokens_token_unique` (`token`),
301+
ADD KEY `personal_access_tokens_tokenable_type_tokenable_id_index` (`tokenable_type`,`tokenable_id`);
302+
303+
--
304+
-- Indices de la tabla `products`
305+
--
306+
ALTER TABLE `products`
307+
ADD PRIMARY KEY (`id`),
308+
ADD KEY `products_id_category_foreign` (`id_category`);
309+
310+
--
311+
-- Indices de la tabla `users`
312+
--
313+
ALTER TABLE `users`
314+
ADD PRIMARY KEY (`id`),
315+
ADD UNIQUE KEY `users_email_unique` (`email`);
316+
317+
--
318+
-- AUTO_INCREMENT de las tablas volcadas
319+
--
320+
321+
--
322+
-- AUTO_INCREMENT de la tabla `categories`
323+
--
324+
ALTER TABLE `categories`
325+
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
326+
327+
--
328+
-- AUTO_INCREMENT de la tabla `clients`
329+
--
330+
ALTER TABLE `clients`
331+
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
332+
333+
--
334+
-- AUTO_INCREMENT de la tabla `failed_jobs`
335+
--
336+
ALTER TABLE `failed_jobs`
337+
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
338+
339+
--
340+
-- AUTO_INCREMENT de la tabla `migrations`
341+
--
342+
ALTER TABLE `migrations`
343+
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
344+
345+
--
346+
-- AUTO_INCREMENT de la tabla `orders`
347+
--
348+
ALTER TABLE `orders`
349+
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;
350+
351+
--
352+
-- AUTO_INCREMENT de la tabla `personal_access_tokens`
353+
--
354+
ALTER TABLE `personal_access_tokens`
355+
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
356+
357+
--
358+
-- AUTO_INCREMENT de la tabla `products`
359+
--
360+
ALTER TABLE `products`
361+
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
362+
363+
--
364+
-- AUTO_INCREMENT de la tabla `users`
365+
--
366+
ALTER TABLE `users`
367+
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
368+
369+
--
370+
-- Restricciones para tablas volcadas
371+
--
372+
373+
--
374+
-- Filtros para la tabla `orders`
375+
--
376+
ALTER TABLE `orders`
377+
ADD CONSTRAINT `orders_id_client_foreign` FOREIGN KEY (`id_client`) REFERENCES `clients` (`id`) ON DELETE CASCADE,
378+
ADD CONSTRAINT `orders_id_product_foreign` FOREIGN KEY (`id_product`) REFERENCES `products` (`id`) ON DELETE CASCADE;
379+
380+
--
381+
-- Filtros para la tabla `products`
382+
--
383+
ALTER TABLE `products`
384+
ADD CONSTRAINT `products_id_category_foreign` FOREIGN KEY (`id_category`) REFERENCES `categories` (`id`) ON DELETE CASCADE;
385+
COMMIT;
386+
387+
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
388+
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
389+
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

0 commit comments

Comments
 (0)