From 7edc369773ce52449be5b2a59f0fd0f677a59ed2 Mon Sep 17 00:00:00 2001 From: jze9 Date: Mon, 6 Apr 2026 19:48:44 +0500 Subject: [PATCH] finaly --- TailAndPaws.sql | 460 +++++++------------------------- docker-compose.yml | 1 + docker/nginx/reverse-proxy.conf | 15 +- 3 files changed, 109 insertions(+), 367 deletions(-) diff --git a/TailAndPaws.sql b/TailAndPaws.sql index abd95d3..521d0f9 100644 --- a/TailAndPaws.sql +++ b/TailAndPaws.sql @@ -1,34 +1,25 @@ --- phpMyAdmin SQL Dump --- version 5.2.0 --- https://www.phpmyadmin.net/ --- --- Servidor: 127.0.0.1:3306 --- Tiempo de generación: 06-04-2026 a las 16:37:55 --- Versión del servidor: 10.4.26-MariaDB-log --- Versión de PHP: 8.1.9 +-- TailAndPaws — дамп базы данных +-- MySQL 8.0 / MariaDB 10.4+ +-- Сгенерировано: 2026-04-06 -SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +CREATE DATABASE IF NOT EXISTS `tailandpaws` + CHARACTER SET utf8mb4 + COLLATE utf8mb4_unicode_ci; + +USE `tailandpaws`; + +SET SQL_MODE = 'NO_AUTO_VALUE_ON_ZERO'; START TRANSACTION; -SET time_zone = "+00:00"; +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: `TailAndPaws` --- - --- -------------------------------------------------------- - --- --- Estructura de tabla para la tabla `brands` --- +DROP TABLE IF EXISTS `brands`; CREATE TABLE `brands` ( - `id` bigint(20) UNSIGNED NOT NULL, + `id` bigint UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `description` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, @@ -38,9 +29,6 @@ CREATE TABLE `brands` ( `is_active` tinyint(1) NOT NULL DEFAULT 1 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; --- --- Volcado de datos para la tabla `brands` --- INSERT INTO `brands` (`id`, `name`, `slug`, `description`, `logo`, `website`, `country`, `is_active`) VALUES (1, 'Royal Canin', 'royal-canin', 'Премиальные корма для кошек и собак', 'Royal-Canin-Logo.png', 'https://www.royalcanin.com', 'Франция', 1), @@ -59,49 +47,39 @@ INSERT INTO `brands` (`id`, `name`, `slug`, `description`, `logo`, `website`, `c -- -------------------------------------------------------- --- --- Estructura de tabla para la tabla `cart_items` --- +DROP TABLE IF EXISTS `cart_items`; CREATE TABLE `cart_items` ( - `id` bigint(20) UNSIGNED NOT NULL, - `user_id` bigint(20) UNSIGNED DEFAULT NULL, + `id` bigint UNSIGNED NOT NULL, + `user_id` bigint UNSIGNED DEFAULT NULL, `session_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `variation_id` bigint(20) UNSIGNED NOT NULL, - `quantity` int(11) NOT NULL DEFAULT 1, + `variation_id` bigint UNSIGNED NOT NULL, + `quantity` int NOT NULL DEFAULT 1, `price` decimal(10,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 `cart_items` --- INSERT INTO `cart_items` (`id`, `user_id`, `session_id`, `variation_id`, `quantity`, `price`, `created_at`, `updated_at`) VALUES (20, 1, 'FsRQjMKDSOThcwwPUvflAKIrh9FN4myyQTqA0M3B', 46, 1, '1999.00', '2026-04-06 06:51:52', '2026-04-06 06:51:52'); -- -------------------------------------------------------- --- --- Estructura de tabla para la tabla `categories` --- +DROP TABLE IF EXISTS `categories`; CREATE TABLE `categories` ( - `id` bigint(20) UNSIGNED NOT NULL, + `id` bigint UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `description` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, `icon` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `parent_id` bigint(20) UNSIGNED DEFAULT NULL, - `sort_order` int(11) NOT NULL DEFAULT 0, + `parent_id` bigint UNSIGNED DEFAULT NULL, + `sort_order` int NOT NULL DEFAULT 0, `is_active` tinyint(1) NOT NULL DEFAULT 1 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; --- --- Volcado de datos para la tabla `categories` --- INSERT INTO `categories` (`id`, `name`, `slug`, `description`, `icon`, `image`, `parent_id`, `sort_order`, `is_active`) VALUES (1, 'Для собак', 'dlya-sobak', 'Всё необходимое для вашего четвероногого друга: от качественного питания до удобной амуниции и развивающих игрушек. Позаботьтесь о здоровье и счастье вашей собаки вместе с TailAndPaws!', 'dlya-sobak.svg', 'dlia-sobak_image.jpg', NULL, 10, 1), @@ -167,12 +145,10 @@ INSERT INTO `categories` (`id`, `name`, `slug`, `description`, `icon`, `image`, -- -------------------------------------------------------- --- --- Estructura de tabla para la tabla `contacts` --- +DROP TABLE IF EXISTS `contacts`; CREATE TABLE `contacts` ( - `id` bigint(20) UNSIGNED NOT NULL, + `id` bigint UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Хвостики и лапки', `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `logo` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, @@ -191,44 +167,34 @@ CREATE TABLE `contacts` ( `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; --- --- Volcado de datos para la tabla `contacts` --- INSERT INTO `contacts` (`id`, `name`, `description`, `logo`, `favicon`, `phone`, `email`, `address`, `work_hours`, `telegram`, `whatsapp`, `vkontakte`, `meta_title`, `meta_description`, `meta_keywords`, `created_at`, `updated_at`) VALUES (1, 'Хвостики и лапки', NULL, 'logo.svg', 'favicon.svg', '+7(985)-070-56-33', 'tailandpaws_info@gmail.com', 'г. Челябинск, ул. Дружбы, д. 15', '10:00 - 18:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); -- -------------------------------------------------------- --- --- Estructura de tabla para la tabla `failed_jobs` --- +DROP TABLE IF EXISTS `failed_jobs`; CREATE TABLE `failed_jobs` ( - `id` bigint(20) UNSIGNED NOT NULL, + `id` bigint UNSIGNED NOT NULL, `uuid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `connection` text COLLATE utf8mb4_unicode_ci NOT NULL, `queue` text COLLATE utf8mb4_unicode_ci NOT NULL, `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL, - `failed_at` timestamp NOT NULL DEFAULT current_timestamp() + `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) 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, + `id` int UNSIGNED NOT NULL, `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, - `batch` int(11) NOT NULL + `batch` int 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 (14, '2014_10_12_000000_create_users_table', 1), @@ -257,14 +223,12 @@ INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES -- -------------------------------------------------------- --- --- Estructura de tabla para la tabla `orders` --- +DROP TABLE IF EXISTS `orders`; CREATE TABLE `orders` ( - `id` bigint(20) UNSIGNED NOT NULL, + `id` bigint UNSIGNED NOT NULL, `order_number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, - `user_id` bigint(20) UNSIGNED DEFAULT NULL, + `user_id` bigint UNSIGNED DEFAULT NULL, `customer_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `customer_email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `customer_phone` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, @@ -282,9 +246,6 @@ CREATE TABLE `orders` ( `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; --- --- Volcado de datos para la tabla `orders` --- INSERT INTO `orders` (`id`, `order_number`, `user_id`, `customer_name`, `customer_email`, `customer_phone`, `shipping_address`, `subtotal`, `shipping_cost`, `discount`, `total`, `payment_method`, `payment_status`, `delivery_method`, `delivery_status`, `comment`, `created_at`, `updated_at`) VALUES (1, 'ORD-20260402-69CDC5BBD6FEB', 1, 'duckinahatt', 'margaritaborodovskih@gmail.com', '+7(909)-090-86-13', NULL, '5403.00', '0.00', '0.00', '5403.00', 'cash', 'paid', 'pickup', 'delivered', NULL, '2026-04-01 22:26:19', '2026-04-06 06:04:06'), @@ -293,27 +254,22 @@ INSERT INTO `orders` (`id`, `order_number`, `user_id`, `customer_name`, `custome -- -------------------------------------------------------- --- --- Estructura de tabla para la tabla `order_items` --- +DROP TABLE IF EXISTS `order_items`; CREATE TABLE `order_items` ( - `id` bigint(20) UNSIGNED NOT NULL, - `order_id` bigint(20) UNSIGNED NOT NULL, - `variation_id` bigint(20) UNSIGNED NOT NULL, + `id` bigint UNSIGNED NOT NULL, + `order_id` bigint UNSIGNED NOT NULL, + `variation_id` bigint UNSIGNED NOT NULL, `product_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `variation_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `sku` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `quantity` int(11) NOT NULL, + `quantity` int NOT NULL, `price` decimal(10,2) NOT NULL, `total` decimal(10,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 `order_items` --- INSERT INTO `order_items` (`id`, `order_id`, `variation_id`, `product_name`, `variation_name`, `sku`, `quantity`, `price`, `total`, `created_at`, `updated_at`) VALUES (1, 1, 60, 'AlphaPet Сухой корм для стерилизованных кошек', 'AlphaPet Сухой корм для стерилизованных кошек, с ягненком и индейкой, 1,5 кг', '1053741', 1, '1969.00', '1969.00', '2026-04-01 22:26:19', '2026-04-01 22:26:19'), @@ -325,10 +281,8 @@ INSERT INTO `order_items` (`id`, `order_id`, `variation_id`, `product_name`, `va -- -------------------------------------------------------- --- --- Estructura de tabla para la tabla `password_reset_tokens` --- +DROP TABLE IF EXISTS `password_reset_tokens`; CREATE TABLE `password_reset_tokens` ( `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, @@ -337,21 +291,16 @@ CREATE TABLE `password_reset_tokens` ( -- -------------------------------------------------------- --- --- Estructura de tabla para la tabla `permissions` --- +DROP TABLE IF EXISTS `permissions`; CREATE TABLE `permissions` ( - `id` bigint(20) UNSIGNED NOT NULL, + `id` bigint UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `group` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `description` text COLLATE utf8mb4_unicode_ci DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; --- --- Volcado de datos para la tabla `permissions` --- INSERT INTO `permissions` (`id`, `name`, `slug`, `group`, `description`) VALUES (1, 'Доступ в личный кабинет', 'cabinet_access', 'cabinet', 'Возможность входить в личный кабинет и просматривать свои данные'), @@ -371,21 +320,16 @@ INSERT INTO `permissions` (`id`, `name`, `slug`, `group`, `description`) VALUES -- -------------------------------------------------------- --- --- Estructura de tabla para la tabla `permission_role` --- +DROP TABLE IF EXISTS `permission_role`; CREATE TABLE `permission_role` ( - `id` bigint(20) UNSIGNED NOT NULL, - `permission_id` bigint(20) UNSIGNED NOT NULL, - `role_id` bigint(20) UNSIGNED NOT NULL, + `id` bigint UNSIGNED NOT NULL, + `permission_id` bigint UNSIGNED NOT NULL, + `role_id` bigint UNSIGNED 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 `permission_role` --- INSERT INTO `permission_role` (`id`, `permission_id`, `role_id`, `created_at`, `updated_at`) VALUES (1, 14, 2, '2026-03-14 18:11:29', '2026-03-14 18:11:29'), @@ -423,14 +367,12 @@ INSERT INTO `permission_role` (`id`, `permission_id`, `role_id`, `created_at`, ` -- -------------------------------------------------------- --- --- Estructura de tabla para la tabla `personal_access_tokens` --- +DROP TABLE IF EXISTS `personal_access_tokens`; CREATE TABLE `personal_access_tokens` ( - `id` bigint(20) UNSIGNED NOT NULL, + `id` bigint UNSIGNED NOT NULL, `tokenable_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, - `tokenable_id` bigint(20) UNSIGNED NOT NULL, + `tokenable_id` bigint UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `token` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL, `abilities` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, @@ -442,17 +384,15 @@ CREATE TABLE `personal_access_tokens` ( -- -------------------------------------------------------- --- --- Estructura de tabla para la tabla `products` --- +DROP TABLE IF EXISTS `products`; CREATE TABLE `products` ( - `id` bigint(20) UNSIGNED NOT NULL, + `id` bigint UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `description` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `brand_id` bigint(20) UNSIGNED DEFAULT NULL, - `category_id` bigint(20) UNSIGNED NOT NULL, + `brand_id` bigint UNSIGNED DEFAULT NULL, + `category_id` bigint UNSIGNED NOT NULL, `is_active` tinyint(1) NOT NULL DEFAULT 1, `meta_title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `meta_description` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, @@ -461,9 +401,6 @@ CREATE TABLE `products` ( `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; --- --- Volcado de datos para la tabla `products` --- INSERT INTO `products` (`id`, `name`, `slug`, `description`, `brand_id`, `category_id`, `is_active`, `meta_title`, `meta_description`, `meta_keywords`, `created_at`, `updated_at`) VALUES (12, 'Rungo Ошейник нейлоновый с ручкой для собак K-9, L', 'rungo-oseinik-neilonovyi-s-ruckoi-dlia-sobak-k-9-l', 'Ошейник K-9 от бренда RUNGO – надежный аксессуар для дополнительного контроля собаки на прогулках, в поездках, при дрессировке.\r\nРазмер: обхват шеи 42-65 см, ширина 3,8 см', 10, 7, 1, 'Вот вариант для этого товара: Meta Title: Rungo ошейник нейлоновый с ручкой K-9 для собак, L', 'Прочный нейлоновый ошейник Rungo K-9 с удобной ручкой для контроля собаки. Размер L, надежная посадка и комфорт в ежедневном использовании.', 'rungo ошейник, ошейник для собак, нейлоновый ошейник, ошейник с ручкой, rungo k-9, ошейник l, ошейник для крупных собак, амуниция для собак', '2026-03-28 18:14:26', '2026-03-28 18:14:26'), @@ -508,22 +445,17 @@ INSERT INTO `products` (`id`, `name`, `slug`, `description`, `brand_id`, `catego -- -------------------------------------------------------- --- --- Estructura de tabla para la tabla `product_attributes` --- +DROP TABLE IF EXISTS `product_attributes`; CREATE TABLE `product_attributes` ( - `id` bigint(20) UNSIGNED NOT NULL, - `product_id` bigint(20) UNSIGNED NOT NULL, + `id` bigint UNSIGNED NOT NULL, + `product_id` bigint UNSIGNED NOT NULL, `key` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `value` text 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 `product_attributes` --- INSERT INTO `product_attributes` (`id`, `product_id`, `key`, `value`, `created_at`, `updated_at`) VALUES (19, 12, 'Размер питомца', 'Все размеры', '2026-03-28 18:14:26', '2026-03-28 18:14:26'), @@ -607,27 +539,22 @@ INSERT INTO `product_attributes` (`id`, `product_id`, `key`, `value`, `created_a -- -------------------------------------------------------- --- --- Estructura de tabla para la tabla `product_variations` --- +DROP TABLE IF EXISTS `product_variations`; CREATE TABLE `product_variations` ( - `id` bigint(20) UNSIGNED NOT NULL, - `product_id` bigint(20) UNSIGNED NOT NULL, + `id` bigint UNSIGNED NOT NULL, + `product_id` bigint UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `sku` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `price` decimal(10,2) NOT NULL, `old_price` decimal(10,2) DEFAULT NULL, - `stock` int(11) NOT NULL DEFAULT 0, + `stock` int NOT NULL DEFAULT 0, `is_default` tinyint(1) NOT NULL DEFAULT 0, `is_active` tinyint(1) 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; --- --- Volcado de datos para la tabla `product_variations` --- INSERT INTO `product_variations` (`id`, `product_id`, `name`, `sku`, `price`, `old_price`, `stock`, `is_default`, `is_active`, `created_at`, `updated_at`) VALUES (22, 12, 'Rungo Ошейник нейлоновый с ручкой для собак K-9, L, обхват шеи 42-65 см, ширина 3,8 см, черный', '1064128', '1749.00', NULL, 25, 1, 1, '2026-03-28 18:14:26', '2026-03-28 18:14:26'), @@ -726,21 +653,19 @@ INSERT INTO `product_variations` (`id`, `product_id`, `name`, `sku`, `price`, `o -- -------------------------------------------------------- --- --- Estructura de tabla para la tabla `reviews` --- +DROP TABLE IF EXISTS `reviews`; CREATE TABLE `reviews` ( - `id` bigint(20) UNSIGNED NOT NULL, - `user_id` bigint(20) UNSIGNED NOT NULL, - `product_id` bigint(20) UNSIGNED NOT NULL, - `rating` tinyint(4) NOT NULL, + `id` bigint UNSIGNED NOT NULL, + `user_id` bigint UNSIGNED NOT NULL, + `product_id` bigint UNSIGNED NOT NULL, + `rating` tinyint NOT NULL, `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `comment` text COLLATE utf8mb4_unicode_ci NOT NULL, `advantages` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, `disadvantages` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `helpful_count` int(11) NOT NULL DEFAULT 0, - `unhelpful_count` int(11) NOT NULL DEFAULT 0, + `helpful_count` int NOT NULL DEFAULT 0, + `unhelpful_count` int NOT NULL DEFAULT 0, `is_approved` tinyint(1) NOT NULL DEFAULT 0, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL @@ -748,20 +673,15 @@ CREATE TABLE `reviews` ( -- -------------------------------------------------------- --- --- Estructura de tabla para la tabla `roles` --- +DROP TABLE IF EXISTS `roles`; CREATE TABLE `roles` ( - `id` bigint(20) UNSIGNED NOT NULL, + `id` bigint UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; --- --- Volcado de datos para la tabla `roles` --- INSERT INTO `roles` (`id`, `name`, `slug`, `description`) VALUES (1, 'Супер администратор', 'super_admin', 'Полный доступ ко всем функциям системы (обходит все проверки прав)'), @@ -773,12 +693,10 @@ INSERT INTO `roles` (`id`, `name`, `slug`, `description`) VALUES -- -------------------------------------------------------- --- --- Estructura de tabla para la tabla `users` --- +DROP TABLE IF EXISTS `users`; CREATE TABLE `users` ( - `id` bigint(20) UNSIGNED NOT NULL, + `id` bigint UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `phone` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL, @@ -787,12 +705,9 @@ CREATE TABLE `users` ( `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, - `role_id` bigint(20) UNSIGNED DEFAULT NULL + `role_id` bigint UNSIGNED DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; --- --- Volcado de datos para la tabla `users` --- INSERT INTO `users` (`id`, `name`, `email`, `phone`, `email_verified_at`, `password`, `remember_token`, `created_at`, `updated_at`, `role_id`) VALUES (1, 'duckinahat', 'margaritaborodovskih@gmail.com', '+7(909)-090-86-13', NULL, '$2y$12$DA50T5Pr3l1EYQyf4/LYd.PmtAVm9bIXcF5lpqV5qiLV3hrCrOP2e', 'QncGrCIXhpPDpCigKEchTXoSyE2dFs9G0eCKTfnKBqKMFgfk1ltjx5mHBAmM', '2026-03-18 15:31:55', '2026-04-06 04:51:11', 1), @@ -800,22 +715,17 @@ INSERT INTO `users` (`id`, `name`, `email`, `phone`, `email_verified_at`, `passw -- -------------------------------------------------------- --- --- Estructura de tabla para la tabla `variation_attributes` --- +DROP TABLE IF EXISTS `variation_attributes`; CREATE TABLE `variation_attributes` ( - `id` bigint(20) UNSIGNED NOT NULL, - `variation_id` bigint(20) UNSIGNED NOT NULL, + `id` bigint UNSIGNED NOT NULL, + `variation_id` bigint UNSIGNED NOT NULL, `key` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `value` varchar(255) 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 `variation_attributes` --- INSERT INTO `variation_attributes` (`id`, `variation_id`, `key`, `value`, `created_at`, `updated_at`) VALUES (1, 22, 'color', 'Черный', '2026-03-28 18:14:26', '2026-03-28 18:14:26'), @@ -932,22 +842,17 @@ INSERT INTO `variation_attributes` (`id`, `variation_id`, `key`, `value`, `creat -- -------------------------------------------------------- --- --- Estructura de tabla para la tabla `variation_images` --- +DROP TABLE IF EXISTS `variation_images`; CREATE TABLE `variation_images` ( - `id` bigint(20) UNSIGNED NOT NULL, - `variation_id` bigint(20) UNSIGNED NOT NULL, + `id` bigint UNSIGNED NOT NULL, + `variation_id` bigint UNSIGNED NOT NULL, `path` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, - `sort_order` int(11) NOT NULL DEFAULT 0, + `sort_order` int 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 `variation_images` --- INSERT INTO `variation_images` (`id`, `variation_id`, `path`, `sort_order`, `created_at`, `updated_at`) VALUES (25, 22, 'assets/images/products/rungo-oseinik-neilonovyi-s-ruckoi-dlia-sobak-k-9-l/variation_22/0.webp', 0, '2026-03-28 18:14:26', '2026-03-28 18:14:26'), @@ -1093,29 +998,17 @@ INSERT INTO `variation_images` (`id`, `variation_id`, `path`, `sort_order`, `cre (183, 136, 'assets/images/products/grandorf-holistic-adult-sterilised-suxoi-korm-dlia-vzroslyx-sterilizovannyx-kosek/variation_136/1.webp', 1, NULL, NULL), (184, 136, 'assets/images/products/grandorf-holistic-adult-sterilised-suxoi-korm-dlia-vzroslyx-sterilizovannyx-kosek/variation_136/2.webp', 2, NULL, NULL); --- --- Índices para tablas volcadas --- --- --- Indices de la tabla `brands` --- ALTER TABLE `brands` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `brands_slug_unique` (`slug`); --- --- Indices de la tabla `cart_items` --- ALTER TABLE `cart_items` ADD PRIMARY KEY (`id`), ADD KEY `cart_items_variation_id_foreign` (`variation_id`), ADD KEY `cart_items_user_id_session_id_index` (`user_id`,`session_id`), ADD KEY `cart_items_session_id_index` (`session_id`); --- --- Indices de la tabla `categories` --- ALTER TABLE `categories` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `categories_slug_unique` (`slug`), @@ -1123,74 +1016,44 @@ ALTER TABLE `categories` ADD KEY `categories_parent_id_index` (`parent_id`), ADD KEY `categories_sort_order_index` (`sort_order`); --- --- Indices de la tabla `contacts` --- ALTER TABLE `contacts` ADD PRIMARY KEY (`id`); --- --- Indices de la tabla `failed_jobs` --- ALTER TABLE `failed_jobs` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`); --- --- Indices de la tabla `migrations` --- ALTER TABLE `migrations` ADD PRIMARY KEY (`id`); --- --- Indices de la tabla `orders` --- ALTER TABLE `orders` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `orders_order_number_unique` (`order_number`), ADD KEY `orders_user_id_foreign` (`user_id`); --- --- Indices de la tabla `order_items` --- ALTER TABLE `order_items` ADD PRIMARY KEY (`id`), ADD KEY `order_items_order_id_foreign` (`order_id`), ADD KEY `order_items_variation_id_foreign` (`variation_id`); --- --- Indices de la tabla `password_reset_tokens` --- ALTER TABLE `password_reset_tokens` ADD PRIMARY KEY (`email`); --- --- Indices de la tabla `permissions` --- ALTER TABLE `permissions` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `permissions_name_unique` (`name`), ADD UNIQUE KEY `permissions_slug_unique` (`slug`); --- --- Indices de la tabla `permission_role` --- ALTER TABLE `permission_role` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `permission_role_permission_id_role_id_unique` (`permission_id`,`role_id`), ADD KEY `permission_role_role_id_foreign` (`role_id`); --- --- Indices de la tabla `personal_access_tokens` --- ALTER TABLE `personal_access_tokens` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `personal_access_tokens_token_unique` (`token`), ADD KEY `personal_access_tokens_tokenable_type_tokenable_id_index` (`tokenable_type`,`tokenable_id`); --- --- Indices de la tabla `products` --- ALTER TABLE `products` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `products_slug_unique` (`slug`), @@ -1198,25 +1061,16 @@ ALTER TABLE `products` ADD KEY `products_category_id_index` (`category_id`), ADD KEY `products_is_active_index` (`is_active`); --- --- Indices de la tabla `product_attributes` --- ALTER TABLE `product_attributes` ADD PRIMARY KEY (`id`), ADD KEY `product_attributes_product_id_key_index` (`product_id`,`key`); --- --- Indices de la tabla `product_variations` --- ALTER TABLE `product_variations` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `product_variations_sku_unique` (`sku`), ADD KEY `product_variations_sku_index` (`sku`), ADD KEY `product_variations_product_id_index` (`product_id`); --- --- Indices de la tabla `reviews` --- ALTER TABLE `reviews` ADD PRIMARY KEY (`id`), ADD KEY `reviews_user_id_foreign` (`user_id`), @@ -1225,17 +1079,11 @@ ALTER TABLE `reviews` ADD KEY `reviews_is_approved_index` (`is_approved`), ADD KEY `reviews_created_at_index` (`created_at`); --- --- Indices de la tabla `roles` --- ALTER TABLE `roles` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `roles_name_unique` (`name`), ADD UNIQUE KEY `roles_slug_unique` (`slug`); --- --- Indices de la tabla `users` --- ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `users_email_unique` (`email`), @@ -1243,220 +1091,114 @@ ALTER TABLE `users` ADD KEY `users_email_index` (`email`), ADD KEY `users_role_id_foreign` (`role_id`); --- --- Indices de la tabla `variation_attributes` --- ALTER TABLE `variation_attributes` ADD PRIMARY KEY (`id`), ADD KEY `variation_attributes_variation_id_key_index` (`variation_id`,`key`); --- --- Indices de la tabla `variation_images` --- ALTER TABLE `variation_images` ADD PRIMARY KEY (`id`), ADD KEY `variation_images_variation_id_sort_order_index` (`variation_id`,`sort_order`); --- --- AUTO_INCREMENT de las tablas volcadas --- --- --- AUTO_INCREMENT de la tabla `brands` --- ALTER TABLE `brands` - MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17; + MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17; --- --- AUTO_INCREMENT de la tabla `cart_items` --- ALTER TABLE `cart_items` - MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21; + MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21; --- --- AUTO_INCREMENT de la tabla `categories` --- ALTER TABLE `categories` - MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=66; + MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=66; --- --- AUTO_INCREMENT de la tabla `contacts` --- ALTER TABLE `contacts` - MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; + MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; --- --- AUTO_INCREMENT de la tabla `failed_jobs` --- ALTER TABLE `failed_jobs` - MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT; + MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT; --- --- AUTO_INCREMENT de la tabla `migrations` --- ALTER TABLE `migrations` - MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=37; + MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=37; --- --- AUTO_INCREMENT de la tabla `orders` --- ALTER TABLE `orders` - MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; + MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; --- --- AUTO_INCREMENT de la tabla `order_items` --- ALTER TABLE `order_items` - MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; + MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; --- --- AUTO_INCREMENT de la tabla `permissions` --- ALTER TABLE `permissions` - MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16; + MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16; --- --- AUTO_INCREMENT de la tabla `permission_role` --- ALTER TABLE `permission_role` - MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=38; + MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=38; --- --- AUTO_INCREMENT de la tabla `personal_access_tokens` --- ALTER TABLE `personal_access_tokens` - MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT; + MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT; --- --- AUTO_INCREMENT de la tabla `products` --- ALTER TABLE `products` - MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=60; + MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=60; --- --- AUTO_INCREMENT de la tabla `product_attributes` --- ALTER TABLE `product_attributes` - MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=207; + MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=207; --- --- AUTO_INCREMENT de la tabla `product_variations` --- ALTER TABLE `product_variations` - MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=142; + MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=142; --- --- AUTO_INCREMENT de la tabla `reviews` --- ALTER TABLE `reviews` - MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT; + MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT; --- --- AUTO_INCREMENT de la tabla `roles` --- ALTER TABLE `roles` - MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; + MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; --- --- AUTO_INCREMENT de la tabla `users` --- ALTER TABLE `users` - MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; + MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; --- --- AUTO_INCREMENT de la tabla `variation_attributes` --- ALTER TABLE `variation_attributes` - MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=271; + MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=271; --- --- AUTO_INCREMENT de la tabla `variation_images` --- ALTER TABLE `variation_images` - MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=185; + MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=185; --- -- Restricciones para tablas volcadas --- --- --- Filtros para la tabla `cart_items` --- ALTER TABLE `cart_items` ADD CONSTRAINT `cart_items_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `cart_items_variation_id_foreign` FOREIGN KEY (`variation_id`) REFERENCES `product_variations` (`id`) ON DELETE CASCADE; --- --- Filtros para la tabla `categories` --- ALTER TABLE `categories` ADD CONSTRAINT `categories_parent_id_foreign` FOREIGN KEY (`parent_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE; --- --- Filtros para la tabla `orders` --- ALTER TABLE `orders` ADD CONSTRAINT `orders_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL; --- --- Filtros para la tabla `order_items` --- ALTER TABLE `order_items` ADD CONSTRAINT `order_items_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `order_items_variation_id_foreign` FOREIGN KEY (`variation_id`) REFERENCES `product_variations` (`id`) ON DELETE CASCADE; --- --- Filtros para la tabla `permission_role` --- ALTER TABLE `permission_role` ADD CONSTRAINT `permission_role_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `permission_role_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE; --- --- Filtros para la tabla `products` --- ALTER TABLE `products` ADD CONSTRAINT `products_brand_id_foreign` FOREIGN KEY (`brand_id`) REFERENCES `brands` (`id`) ON DELETE SET NULL, ADD CONSTRAINT `products_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE; --- --- Filtros para la tabla `product_attributes` --- ALTER TABLE `product_attributes` ADD CONSTRAINT `product_attributes_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE; --- --- Filtros para la tabla `product_variations` --- ALTER TABLE `product_variations` ADD CONSTRAINT `product_variations_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE; --- --- Filtros para la tabla `reviews` --- ALTER TABLE `reviews` ADD CONSTRAINT `reviews_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `reviews_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE; --- --- Filtros para la tabla `users` --- ALTER TABLE `users` ADD CONSTRAINT `users_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE SET NULL; --- --- Filtros para la tabla `variation_attributes` --- ALTER TABLE `variation_attributes` ADD CONSTRAINT `variation_attributes_variation_id_foreign` FOREIGN KEY (`variation_id`) REFERENCES `product_variations` (`id`) ON DELETE CASCADE; --- --- Filtros para la tabla `variation_images` --- ALTER TABLE `variation_images` ADD CONSTRAINT `variation_images_variation_id_foreign` FOREIGN KEY (`variation_id`) REFERENCES `product_variations` (`id`) ON DELETE 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 */; +SET FOREIGN_KEY_CHECKS = 1; diff --git a/docker-compose.yml b/docker-compose.yml index 2053e8a..e4f4f20 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -33,6 +33,7 @@ services: image: mysql:8.0 container_name: tailandpaws_db restart: unless-stopped + command: --default-authentication-plugin=mysql_native_password environment: MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD:-rootsecret} MYSQL_DATABASE: ${DB_DATABASE:-tailandpaws} diff --git a/docker/nginx/reverse-proxy.conf b/docker/nginx/reverse-proxy.conf index 365b687..c72a5bb 100644 --- a/docker/nginx/reverse-proxy.conf +++ b/docker/nginx/reverse-proxy.conf @@ -15,6 +15,13 @@ # 0 3 * * * certbot renew --pre-hook "systemctl stop nginx" --post-hook "systemctl start nginx" --quiet # ────────────────────────────────────────────────────────────── +# WebSocket upgrade map — должен быть на уровне http {} +# Файл подключается через include внутри http {}, поэтому map работает здесь +map $http_upgrade $connection_upgrade { + default upgrade; + '' close; +} + # HTTP → HTTPS redirect server { listen 80; @@ -82,11 +89,3 @@ server { proxy_set_header Connection $connection_upgrade; } } - -# WebSocket upgrade map (нужен вне server-блока, на уровне http) -# Добавьте в /etc/nginx/nginx.conf внутри блока http {}: -# -# map $http_upgrade $connection_upgrade { -# default upgrade; -# '' close; -# }