text: -- phpMyAdmin SQL Dump
  -- version 5.0.1
  -- https://www.phpmyadmin.net/
  --
  -- Servidor: 127.0.0.1
  -- Tiempo de generación: 29-06-2021 a las 04:21:16
  -- Versión del servidor: 10.4.11-MariaDB
  -- Versión de PHP: 7.4.3
  
  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: `blog_db`
  --
  CREATE DATABASE IF NOT EXISTS `blog_db` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
  USE `blog_db`;
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `interactions`
  --
  
  DROP TABLE IF EXISTS `interactions`;
  CREATE TABLE `interactions` (
    `user_id` bigint(20) UNSIGNED NOT NULL,
    `publication_id` bigint(20) UNSIGNED NOT NULL,
    `reaction` char(1) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `visits` tinyint(4) NOT NULL DEFAULT 1,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `migrations`
  --
  
  DROP TABLE IF EXISTS `migrations`;
  CREATE TABLE `migrations` (
    `id` int(10) UNSIGNED NOT NULL,
    `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `batch` int(11) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `oauth_access_tokens`
  --
  
  DROP TABLE IF EXISTS `oauth_access_tokens`;
  CREATE TABLE `oauth_access_tokens` (
    `id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
    `user_id` bigint(20) UNSIGNED DEFAULT NULL,
    `client_id` bigint(20) UNSIGNED NOT NULL,
    `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `scopes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `revoked` tinyint(1) NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL,
    `expires_at` datetime DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `oauth_auth_codes`
  --
  
  DROP TABLE IF EXISTS `oauth_auth_codes`;
  CREATE TABLE `oauth_auth_codes` (
    `id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
    `user_id` bigint(20) UNSIGNED NOT NULL,
    `client_id` bigint(20) UNSIGNED NOT NULL,
    `scopes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `revoked` tinyint(1) NOT NULL,
    `expires_at` datetime DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `oauth_clients`
  --
  
  DROP TABLE IF EXISTS `oauth_clients`;
  CREATE TABLE `oauth_clients` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `user_id` bigint(20) UNSIGNED DEFAULT NULL,
    `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `secret` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `provider` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `redirect` text COLLATE utf8mb4_unicode_ci NOT NULL,
    `personal_access_client` tinyint(1) NOT NULL,
    `password_client` tinyint(1) NOT NULL,
    `revoked` tinyint(1) NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `oauth_personal_access_clients`
  --
  
  DROP TABLE IF EXISTS `oauth_personal_access_clients`;
  CREATE TABLE `oauth_personal_access_clients` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `client_id` bigint(20) UNSIGNED NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `oauth_refresh_tokens`
  --
  
  DROP TABLE IF EXISTS `oauth_refresh_tokens`;
  CREATE TABLE `oauth_refresh_tokens` (
    `id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
    `access_token_id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
    `revoked` tinyint(1) NOT NULL,
    `expires_at` datetime DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `publications`
  --
  
  DROP TABLE IF EXISTS `publications`;
  CREATE TABLE `publications` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `image` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `title` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
    `content` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
    `publish_date` timestamp NOT NULL DEFAULT current_timestamp(),
    `author` 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;
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `users`
  --
  
  DROP TABLE IF EXISTS `users`;
  CREATE TABLE `users` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `name` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
    `lastname` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
    `email` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
    `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `role` tinyint(4) NOT NULL DEFAULT 2,
    `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;
  
  --
  -- Índices para tablas volcadas
  --
  
  --
  -- Indices de la tabla `interactions`
  --
  ALTER TABLE `interactions`
    ADD PRIMARY KEY (`user_id`,`publication_id`),
    ADD KEY `interactions_publication_id_foreign` (`publication_id`);
  
  --
  -- Indices de la tabla `migrations`
  --
  ALTER TABLE `migrations`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indices de la tabla `oauth_access_tokens`
  --
  ALTER TABLE `oauth_access_tokens`
    ADD PRIMARY KEY (`id`),
    ADD KEY `oauth_access_tokens_user_id_index` (`user_id`);
  
  --
  -- Indices de la tabla `oauth_auth_codes`
  --
  ALTER TABLE `oauth_auth_codes`
    ADD PRIMARY KEY (`id`),
    ADD KEY `oauth_auth_codes_user_id_index` (`user_id`);
  
  --
  -- Indices de la tabla `oauth_clients`
  --
  ALTER TABLE `oauth_clients`
    ADD PRIMARY KEY (`id`),
    ADD KEY `oauth_clients_user_id_index` (`user_id`);
  
  --
  -- Indices de la tabla `oauth_personal_access_clients`
  --
  ALTER TABLE `oauth_personal_access_clients`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indices de la tabla `oauth_refresh_tokens`
  --
  ALTER TABLE `oauth_refresh_tokens`
    ADD PRIMARY KEY (`id`),
    ADD KEY `oauth_refresh_tokens_access_token_id_index` (`access_token_id`);
  
  --
  -- Indices de la tabla `publications`
  --
  ALTER TABLE `publications`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indices de la tabla `users`
  --
  ALTER TABLE `users`
    ADD PRIMARY KEY (`id`),
    ADD UNIQUE KEY `users_email_unique` (`email`);
  
  --
  -- AUTO_INCREMENT de las tablas volcadas
  --
  
  --
  -- AUTO_INCREMENT de la tabla `migrations`
  --
  ALTER TABLE `migrations`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT de la tabla `oauth_clients`
  --
  ALTER TABLE `oauth_clients`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT de la tabla `oauth_personal_access_clients`
  --
  ALTER TABLE `oauth_personal_access_clients`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT de la tabla `publications`
  --
  ALTER TABLE `publications`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT de la tabla `users`
  --
  ALTER TABLE `users`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
  
  --
  -- Restricciones para tablas volcadas
  --
  
  --
  -- Filtros para la tabla `interactions`
  --
  ALTER TABLE `interactions`
    ADD CONSTRAINT `interactions_publication_id_foreign` FOREIGN KEY (`publication_id`) REFERENCES `publications` (`id`) ON DELETE CASCADE,
    ADD CONSTRAINT `interactions_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);
  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 */;
  