text: -- phpMyAdmin SQL Dump
  -- version 4.8.5
  -- https://www.phpmyadmin.net/
  --
  -- Servidor: 127.0.0.1
  -- Tiempo de generación: 10-11-2021 a las 21:38:37
  -- Versión del servidor: 10.1.38-MariaDB
  -- Versión de PHP: 7.3.2
  
  SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  SET AUTOCOMMIT = 0;
  START TRANSACTION;
  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: `temp`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `clientes`
  --
  
  CREATE TABLE `clientes` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `cedula` int(11) NOT NULL,
    `nombre_apellido` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Volcado de datos para la tabla `clientes`
  --
  
  INSERT INTO `clientes` (`id`, `cedula`, `nombre_apellido`, `created_at`, `updated_at`) VALUES
  (1, 26851230, 'ALEXANDER SERRANO', '2021-06-24 02:18:34', '2021-06-24 02:18:34'),
  (4, 28342503, 'NELSON FIGUERA', '2021-07-05 01:11:12', '2021-07-05 01:11:12'),
  (5, 11111111, 'CLIENTE PRUEBA', '2021-07-05 01:11:45', '2021-07-05 01:11:45'),
  (6, 12345678, 'CLIENTE PRUEBA II', '2021-07-05 01:12:09', '2021-07-05 01:12:09');
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `migrations`
  --
  
  CREATE TABLE `migrations` (
    `id` int(10) UNSIGNED NOT NULL,
    `migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `batch` int(11) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Volcado de datos para la tabla `migrations`
  --
  
  INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
  (1, '2020_06_03_000010_create_permission_tables', 1),
  (2, '2020_06_03_000100_create_users_table', 1),
  (3, '2020_06_03_233207_create_preguntas_table', 1),
  (4, '2021_06_01_201216_create_productos_table', 1),
  (5, '2021_06_23_195013_create_clientes_table', 1),
  (9, '2021_06_23_196839_create_ventas_table', 2),
  (10, '2021_10_07_212806_create_venta_productos_table', 2);
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `model_has_permissions`
  --
  
  CREATE TABLE `model_has_permissions` (
    `permission_id` bigint(20) UNSIGNED NOT NULL,
    `model_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `model_id` bigint(20) UNSIGNED NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `model_has_roles`
  --
  
  CREATE TABLE `model_has_roles` (
    `role_id` bigint(20) UNSIGNED NOT NULL,
    `model_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `model_id` bigint(20) UNSIGNED NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Volcado de datos para la tabla `model_has_roles`
  --
  
  INSERT INTO `model_has_roles` (`role_id`, `model_type`, `model_id`) VALUES
  (1, 'App\\User', 2),
  (1, 'App\\User', 4),
  (2, 'App\\User', 1);
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `permissions`
  --
  
  CREATE TABLE `permissions` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `guard_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Volcado de datos para la tabla `permissions`
  --
  
  INSERT INTO `permissions` (`id`, `name`, `guard_name`, `created_at`, `updated_at`) VALUES
  (1, 'administrar', 'web', '2021-06-24 01:00:50', '2021-06-24 01:00:50');
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `preguntas`
  --
  
  CREATE TABLE `preguntas` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `user_id` bigint(20) UNSIGNED NOT NULL,
    `pregunta` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `respuesta` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Volcado de datos para la tabla `preguntas`
  --
  
  INSERT INTO `preguntas` (`id`, `user_id`, `pregunta`, `respuesta`, `created_at`, `updated_at`) VALUES
  (1, 1, '¿Cuál es su comida favorita?', '1', '2021-06-27 00:04:24', '2021-06-27 00:04:24'),
  (2, 1, '¿Cuál era el nombre de su mejor amigo/a de la infancia?', '1', '2021-06-27 00:04:24', '2021-06-27 00:04:24'),
  (3, 1, '¿Cuál es su equipo de beisbol favorito?', '1', '2021-06-27 00:04:24', '2021-06-27 00:04:24');
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `productos`
  --
  
  CREATE TABLE `productos` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `nombre` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `descripcion` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `presentacion` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `unidades_presentacion` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `precio` float NOT NULL DEFAULT '0',
    `stock` int(11) NOT NULL DEFAULT '0',
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Volcado de datos para la tabla `productos`
  --
  
  INSERT INTO `productos` (`id`, `nombre`, `descripcion`, `presentacion`, `unidades_presentacion`, `precio`, `stock`, `created_at`, `updated_at`) VALUES
  (1, 'LÁPIZ', 'MARCA MONGOL', 'CAJA', '12', 2.5, 398, NULL, '2021-11-11 00:06:12'),
  (2, 'MARCADOR DE PIZARRA', 'MARCA SHARPIE', 'CAJA', '5', 2, 250, NULL, '2021-10-08 01:11:18'),
  (3, 'MARCADOR PERMANENTE', 'MARCA SHARPIE', 'CAJA', '5', 2, 250, NULL, '2021-10-08 01:11:25'),
  (4, 'CARTULINA VERDE', NULL, 'UNIDAD', '1', 0.5, 500, NULL, '2021-10-08 01:11:36'),
  (5, 'PAPEL BOND', NULL, 'UNIDAD', '1', 0.8, 700, NULL, '2021-10-26 02:28:32'),
  (7, 'BOLÍGRAFO', 'MARCA TRAZO', 'CAJA', '10', 0.75, 600, NULL, '2021-10-08 01:12:06'),
  (8, 'PAPEL TIPO CARTA', 'MARCA ALPES', 'RESMA', '100', 0.1, 80000, NULL, '2021-10-08 01:12:17'),
  (9, 'FOAMI', NULL, 'UNIDAD', '1', 0.25, 740, NULL, '2021-10-08 01:12:36'),
  (10, 'PAPEL CELOFAN', NULL, 'UNIDAD', '1', 0.3, 850, NULL, '2021-10-08 01:12:45'),
  (16, 'Test', 'asd', 'Unidad', '1', 3, 48, '2021-11-11 00:36:51', '2021-11-11 00:41:42');
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `roles`
  --
  
  CREATE TABLE `roles` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `guard_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Volcado de datos para la tabla `roles`
  --
  
  INSERT INTO `roles` (`id`, `name`, `guard_name`, `created_at`, `updated_at`) VALUES
  (1, 'Usuario', 'web', '2021-06-24 01:00:50', '2021-06-24 01:00:50'),
  (2, 'Administrador', 'web', '2021-06-24 01:00:50', '2021-06-24 01:00:50');
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `role_has_permissions`
  --
  
  CREATE TABLE `role_has_permissions` (
    `permission_id` bigint(20) UNSIGNED NOT NULL,
    `role_id` bigint(20) UNSIGNED NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Volcado de datos para la tabla `role_has_permissions`
  --
  
  INSERT INTO `role_has_permissions` (`permission_id`, `role_id`) VALUES
  (1, 2);
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `users`
  --
  
  CREATE TABLE `users` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `username` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Volcado de datos para la tabla `users`
  --
  
  INSERT INTO `users` (`id`, `username`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES
  (1, 'admin', '$2y$10$JeBiOjgp4xMr2vNAAPvH3.2GxrFPYz2.SLRVQoAEBWHzP4AikjfDu', NULL, '2021-06-24 01:00:50', '2021-06-24 01:00:50'),
  (2, 'usuario', '$2y$10$g/xUWW2UURjAZD1IXFf9jOnc3VVW7bXMFoNlNEwaDLZNMquke7gcy', NULL, '2021-07-05 00:26:16', '2021-07-05 00:26:16'),
  (4, 'Alex', '$2y$10$omgXas7yDm7oCuSCaFYQ/O..wlUO.w8Y//xZC/xrzUSSSIksDG/wy', NULL, '2021-07-05 00:31:12', '2021-07-05 00:31:12');
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `ventas`
  --
  
  CREATE TABLE `ventas` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `cliente_id` bigint(20) UNSIGNED NOT NULL,
    `fecha` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `total` double(8,2) NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Volcado de datos para la tabla `ventas`
  --
  
  INSERT INTO `ventas` (`id`, `cliente_id`, `fecha`, `total`, `created_at`, `updated_at`) VALUES
  (1, 1, '25-10-2021', 7.50, '2021-10-26 02:07:11', '2021-10-26 02:07:11'),
  (5, 1, '25-10-2021', 24.00, '2021-10-26 02:28:32', '2021-10-26 02:28:32'),
  (6, 4, '25-10-2021', 2.50, '2021-10-26 02:33:33', '2021-10-26 02:33:33'),
  (7, 1, '10-11-2021', 2.50, '2021-11-11 00:06:11', '2021-11-11 00:06:11');
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `venta_productos`
  --
  
  CREATE TABLE `venta_productos` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `venta_id` bigint(20) UNSIGNED NOT NULL,
    `producto_id` bigint(20) UNSIGNED NOT NULL,
    `cantidad` int(11) NOT NULL,
    `precio` int(11) NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Volcado de datos para la tabla `venta_productos`
  --
  
  INSERT INTO `venta_productos` (`id`, `venta_id`, `producto_id`, `cantidad`, `precio`, `created_at`, `updated_at`) VALUES
  (1, 1, 1, 3, 3, '2021-10-26 02:07:11', '2021-10-26 02:07:11'),
  (3, 5, 5, 30, 1, '2021-10-26 02:28:32', '2021-10-26 02:28:32'),
  (4, 6, 1, 1, 3, '2021-10-26 02:33:33', '2021-10-26 02:33:33'),
  (5, 7, 1, 1, 3, '2021-11-11 00:06:12', '2021-11-11 00:06:12');
  
  --
  -- Índices para tablas volcadas
  --
  
  --
  -- Indices de la tabla `clientes`
  --
  ALTER TABLE `clientes`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indices de la tabla `migrations`
  --
  ALTER TABLE `migrations`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indices de la tabla `model_has_permissions`
  --
  ALTER TABLE `model_has_permissions`
    ADD PRIMARY KEY (`permission_id`,`model_id`,`model_type`),
    ADD KEY `model_has_permissions_model_id_model_type_index` (`model_id`,`model_type`);
  
  --
  -- Indices de la tabla `model_has_roles`
  --
  ALTER TABLE `model_has_roles`
    ADD PRIMARY KEY (`role_id`,`model_id`,`model_type`),
    ADD KEY `model_has_roles_model_id_model_type_index` (`model_id`,`model_type`);
  
  --
  -- Indices de la tabla `permissions`
  --
  ALTER TABLE `permissions`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indices de la tabla `preguntas`
  --
  ALTER TABLE `preguntas`
    ADD PRIMARY KEY (`id`),
    ADD KEY `preguntas_user_id_foreign` (`user_id`);
  
  --
  -- Indices de la tabla `productos`
  --
  ALTER TABLE `productos`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indices de la tabla `roles`
  --
  ALTER TABLE `roles`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indices de la tabla `role_has_permissions`
  --
  ALTER TABLE `role_has_permissions`
    ADD PRIMARY KEY (`permission_id`,`role_id`),
    ADD KEY `role_has_permissions_role_id_foreign` (`role_id`);
  
  --
  -- Indices de la tabla `users`
  --
  ALTER TABLE `users`
    ADD PRIMARY KEY (`id`),
    ADD UNIQUE KEY `users_username_unique` (`username`);
  
  --
  -- Indices de la tabla `ventas`
  --
  ALTER TABLE `ventas`
    ADD PRIMARY KEY (`id`),
    ADD KEY `ventas_cliente_id_foreign` (`cliente_id`);
  
  --
  -- Indices de la tabla `venta_productos`
  --
  ALTER TABLE `venta_productos`
    ADD PRIMARY KEY (`id`),
    ADD KEY `venta_productos_venta_id_foreign` (`venta_id`),
    ADD KEY `venta_productos_producto_id_foreign` (`producto_id`);
  
  --
  -- AUTO_INCREMENT de las tablas volcadas
  --
  
  --
  -- AUTO_INCREMENT de la tabla `clientes`
  --
  ALTER TABLE `clientes`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
  
  --
  -- AUTO_INCREMENT de la tabla `migrations`
  --
  ALTER TABLE `migrations`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
  
  --
  -- AUTO_INCREMENT de la tabla `permissions`
  --
  ALTER TABLE `permissions`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
  
  --
  -- AUTO_INCREMENT de la tabla `preguntas`
  --
  ALTER TABLE `preguntas`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
  
  --
  -- AUTO_INCREMENT de la tabla `productos`
  --
  ALTER TABLE `productos`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;
  
  --
  -- AUTO_INCREMENT de la tabla `roles`
  --
  ALTER TABLE `roles`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
  
  --
  -- AUTO_INCREMENT de la tabla `users`
  --
  ALTER TABLE `users`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
  
  --
  -- AUTO_INCREMENT de la tabla `ventas`
  --
  ALTER TABLE `ventas`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
  
  --
  -- AUTO_INCREMENT de la tabla `venta_productos`
  --
  ALTER TABLE `venta_productos`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
  
  --
  -- Restricciones para tablas volcadas
  --
  
  --
  -- Filtros para la tabla `model_has_permissions`
  --
  ALTER TABLE `model_has_permissions`
    ADD CONSTRAINT `model_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE;
  
  --
  -- Filtros para la tabla `model_has_roles`
  --
  ALTER TABLE `model_has_roles`
    ADD CONSTRAINT `model_has_roles_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;
  
  --
  -- Filtros para la tabla `preguntas`
  --
  ALTER TABLE `preguntas`
    ADD CONSTRAINT `preguntas_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
  
  --
  -- Filtros para la tabla `role_has_permissions`
  --
  ALTER TABLE `role_has_permissions`
    ADD CONSTRAINT `role_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE,
    ADD CONSTRAINT `role_has_permissions_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;
  
  --
  -- Filtros para la tabla `ventas`
  --
  ALTER TABLE `ventas`
    ADD CONSTRAINT `ventas_cliente_id_foreign` FOREIGN KEY (`cliente_id`) REFERENCES `clientes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
  
  --
  -- Filtros para la tabla `venta_productos`
  --
  ALTER TABLE `venta_productos`
    ADD CONSTRAINT `venta_productos_producto_id_foreign` FOREIGN KEY (`producto_id`) REFERENCES `productos` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
    ADD CONSTRAINT `venta_productos_venta_id_foreign` FOREIGN KEY (`venta_id`) REFERENCES `ventas` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
  COMMIT;
  
  /*!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 */;
  