-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 12, 2022 at 01:25 PM
-- Server version: 10.4.21-MariaDB
-- PHP Version: 8.0.12

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
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 */;

--
-- Database: `offers`
--

-- --------------------------------------------------------

--
-- Table structure for table `categories`
--

CREATE TABLE `categories` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name_en` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name_pt` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `name_ar` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` tinyint(1) NOT NULL,
  `parent_id` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `categories`
--

INSERT INTO `categories` (`id`, `name_en`, `name_pt`, `name_ar`, `status`, `parent_id`, `created_at`, `updated_at`) VALUES
(1, 'Jaiden Leannon', 'Jaiden Leannon', 'Jaiden Leannon', 1, NULL, '2022-07-06 04:30:54', '2022-07-06 04:30:54'),
(2, 'Miss Malika Paucek', 'Miss Malika Paucek', 'Miss Malika Paucek', 1, NULL, '2022-07-06 04:30:54', '2022-07-06 04:30:54'),
(3, 'Cloyd Mraz', 'Cloyd Mraz', 'Cloyd Mraz', 1, NULL, '2022-07-06 04:30:54', '2022-07-06 04:30:54'),
(4, 'Alana Zulauf', 'Alana Zulauf', 'Alana Zulauf', 1, NULL, '2022-07-06 04:30:54', '2022-07-06 04:30:54'),
(5, 'Mr. Nikolas Kunze', 'Mr. Nikolas Kunze', 'Mr. Nikolas Kunze', 0, NULL, '2022-07-06 04:30:54', '2022-07-07 05:05:03'),
(6, 'Sandra Sherman', 'Aidan Erickson', 'Quon Koch', 0, 2, '2022-08-04 07:06:45', '2022-08-04 07:06:45');

-- --------------------------------------------------------

--
-- Table structure for table `cities`
--

CREATE TABLE `cities` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name_en` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name_pt` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `name_ar` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` 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;

--
-- Dumping data for table `cities`
--

INSERT INTO `cities` (`id`, `name_en`, `name_pt`, `name_ar`, `status`, `created_at`, `updated_at`) VALUES
(1, 'Javonport', 'Javonport', 'Javonport', 1, '2022-07-06 04:30:54', '2022-07-06 04:30:54'),
(2, 'West Bo', 'West Bo', 'West Bo', 1, '2022-07-06 04:30:54', '2022-07-06 04:30:54'),
(3, 'Jaymemouth', 'Jaymemouth', 'Jaymemouth', 1, '2022-07-06 04:30:54', '2022-07-06 04:30:54'),
(4, 'Hintzbury', 'Hintzbury', 'Hintzbury', 1, '2022-07-06 04:30:54', '2022-07-06 04:30:54'),
(5, 'Ryleighmouth', 'Ryleighmouth', 'Ryleighmouth', 1, '2022-07-06 04:30:54', '2022-07-06 04:30:54');

-- --------------------------------------------------------

--
-- Table structure for table `customers`
--

CREATE TABLE `customers` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `first_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `last_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `gender` enum('Male','Female') COLLATE utf8mb4_unicode_ci NOT NULL,
  `phone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `password` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `profile_image` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` tinyint(1) NOT NULL DEFAULT 1,
  `city_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;

--
-- Dumping data for table `customers`
--

INSERT INTO `customers` (`id`, `first_name`, `last_name`, `gender`, `phone`, `email`, `password`, `profile_image`, `status`, `city_id`, `created_at`, `updated_at`) VALUES
(1, 'Jordane Walter', 'Javonte Dibbert', 'Male', NULL, 'rdoyle@example.org', 'Prof. Alexzander Wuckert', NULL, 0, 1, '2022-07-06 04:30:54', '2022-07-06 04:30:54'),
(2, 'Dr. Jadon Romaguera DVM', 'Marquis Carroll', 'Male', NULL, 'kassulke.justus@example.net', 'Prof. Elvie Blanda', NULL, 1, 1, '2022-07-06 04:30:54', '2022-07-06 04:30:54'),
(3, 'Phyllis Daugherty', 'Prof. Cruz Rice IV', 'Male', NULL, 'nathanael.schumm@example.net', 'Trever Gutmann', NULL, 1, 1, '2022-07-06 04:30:54', '2022-07-06 04:30:54'),
(4, 'Prof. Celine Schaden IV', 'Ernestine Dietrich III', 'Male', NULL, 'luciano.herzog@example.org', 'Prof. Mia Sauer V', NULL, 0, 1, '2022-07-06 04:30:54', '2022-07-06 04:30:54'),
(5, 'Jeanette Franecki', 'Jordane Stanton III', 'Male', NULL, 'laverna.crist@example.com', 'Reta Trantow', NULL, 1, 1, '2022-07-06 04:30:54', '2022-07-06 04:30:54'),
(6, 'Dr. Keenan Corkery PhD', 'Julius Kuvalis', 'Male', NULL, 'citlalli.herman@example.org', 'Dr. Leonor Rempel Sr.', NULL, 1, 1, '2022-07-06 04:30:54', '2022-07-06 08:10:36'),
(7, 'Dean Cruickshank', 'Prof. Raoul Kirlin', 'Male', NULL, 'emilie.upton@example.com', 'Arvel Lakin II', NULL, 1, 1, '2022-07-06 04:30:54', '2022-07-06 08:10:32'),
(8, 'Dr. Georgette Blick', 'Rowan Senger', 'Male', NULL, 'dakota69@example.com', 'Audie Cruickshank Sr.', NULL, 1, 1, '2022-07-06 04:30:54', '2022-07-06 08:10:31'),
(9, 'Fern Schmeler', 'Osborne Lowe', 'Male', NULL, 'dion.wolf@example.org', 'Bennett Dooley', NULL, 1, 1, '2022-07-06 04:30:54', '2022-07-06 04:30:54'),
(10, 'Maxime Armstrong I', 'Karen Reynolds', 'Male', NULL, 'rolson@example.org', 'Mr. Santa Murphy V', NULL, 1, 1, '2022-07-06 04:30:54', '2022-07-06 04:30:54'),
(11, 'Melody Nolan', 'Sonny Predovic', 'Male', NULL, 'ramona.hauck@example.com', 'Hulda Botsford', NULL, 1, 1, '2022-07-06 04:30:54', '2022-07-06 04:30:54'),
(12, 'Mr. Ceasar Herzog', 'Meda Kreiger', 'Male', NULL, 'charles84@example.net', 'Dr. Guido Flatley', NULL, 1, 1, '2022-07-06 04:30:54', '2022-07-06 08:10:19'),
(13, 'Jadon Gerlach', 'Arianna Johnston III', 'Male', NULL, 'efrain46@example.org', 'Ms. Esmeralda Jacobi I', NULL, 1, 1, '2022-07-06 04:30:54', '2022-07-06 08:10:16'),
(14, 'Raleigh Doyle IV', 'Wilton Volkman', 'Male', NULL, 'bonnie.nitzsche@example.net', 'Santa Armstrong', NULL, 0, 1, '2022-07-06 04:30:54', '2022-07-06 08:10:38'),
(15, 'Mauricio Luettgen', 'Cornelius Balistreri', 'Male', NULL, 'jaiden.kirlin@example.org', 'Orville Bradtke PhD', NULL, 1, 1, '2022-07-06 04:30:54', '2022-07-06 08:10:05');

-- --------------------------------------------------------

--
-- Table structure for table `customers_interests`
--

CREATE TABLE `customers_interests` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `category_id` bigint(20) UNSIGNED NOT NULL,
  `customer_id` bigint(20) UNSIGNED NOT NULL,
  `device_token` text COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `customers_interests`
--

INSERT INTO `customers_interests` (`id`, `category_id`, `customer_id`, `device_token`) VALUES
(1, 1, 14, NULL),
(2, 1, 15, NULL),
(3, 3, 10, NULL),
(4, 4, 11, NULL),
(5, 2, 14, NULL);

-- --------------------------------------------------------

--
-- Table structure for table `customer_tracks`
--

CREATE TABLE `customer_tracks` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `customer_id` bigint(20) UNSIGNED DEFAULT NULL,
  `device_token` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `entity_type` enum('search','offer','store','category') COLLATE utf8mb4_unicode_ci NOT NULL,
  `entity_value` varchar(100) 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;

-- --------------------------------------------------------

--
-- Table structure for table `excel_files`
--

CREATE TABLE `excel_files` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_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;

--
-- Dumping data for table `excel_files`
--

INSERT INTO `excel_files` (`id`, `name`, `user_id`, `created_at`, `updated_at`) VALUES
(1, '1657107137_offer.xlsx', 2, '2022-07-06 08:32:17', '2022-07-06 08:32:17'),
(2, '1659260217_offer.xlsx', 2, '2022-07-31 06:36:57', '2022-07-31 06:36:57');

-- --------------------------------------------------------

--
-- Table structure for table `failed_jobs`
--

CREATE TABLE `failed_jobs` (
  `id` bigint(20) 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()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `images`
--

CREATE TABLE `images` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `offer_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;

--
-- Dumping data for table `images`
--

INSERT INTO `images` (`id`, `name`, `offer_id`, `created_at`, `updated_at`) VALUES
(2, 'xPgjzKLD2RPCNSoUTEPfCShXsNfWD04uYGehd8BD.jpg', 4, '2022-07-28 09:26:02', '2022-07-28 09:26:02'),
(3, 'MfMmKUxxLEujZJDjIOOl0hA0Gp9Av6E60bh5w6kj.jpg', 5, '2022-07-28 09:27:41', '2022-07-28 09:27:41'),
(5, '6RfQdsKd7vgvlNRwHM4bZJi2bTvXCjmG4KzEe33k.jpg', 5, '2022-07-28 09:27:41', '2022-07-28 09:27:41'),
(6, 'wWUTYWjxfXzMlOPqrQaHTu0m4adt7rcoqQXoX0BL.jpg', 5, '2022-07-31 06:27:55', '2022-07-31 06:27:55'),
(7, 'jvzyGNqNkAEGYydDzEWnn1TbBdNqYaU6w6S6bnB1.jpg', 9, '2022-08-04 06:52:08', '2022-08-04 06:52:08'),
(8, 'LjzJ21SIXxUKBvliRmqKwkz5BJsv4vyl4pusFVM3.jpg', 10, '2022-08-04 06:53:15', '2022-08-04 06:53:15'),
(9, '4uZtMPsfn1wwWfPgoNvvBiCqTWvI0iBxSv064vbO.jpg', 11, '2022-08-04 07:00:04', '2022-08-04 07:00:04');

-- --------------------------------------------------------

--
-- Table structure for table `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;

--
-- Dumping data for table `migrations`
--

INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2014_10_12_000000_create_users_table', 1),
(2, '2014_10_12_100000_create_password_resets_table', 1),
(3, '2019_08_19_000000_create_failed_jobs_table', 1),
(4, '2019_12_14_000001_create_personal_access_tokens_table', 1),
(5, '2022_05_08_073904_create_cities_table', 1),
(6, '2022_05_09_132003_create_customers_table', 1),
(7, '2022_05_10_115615_create_categories_table', 1),
(8, '2022_05_11_114305_create_customer_interests_table', 1),
(9, '2022_05_11_130903_create_tags_table', 1),
(10, '2022_05_15_061920_create_offer_types_table', 1),
(11, '2022_05_15_072825_create_offers_table', 1),
(12, '2022_05_15_084619_create_offer_tags_table', 1),
(13, '2022_05_15_105538_create_target_areas_table', 1),
(14, '2022_05_15_113632_create_images_table', 1),
(15, '2022_05_19_070348_create_stores_table', 1),
(17, '2022_05_23_100113_create_notifications_table', 1),
(18, '2022_05_24_075532_create_notification_receivers_table', 1),
(19, '2022_06_02_082641_add_role_to_users_table', 1),
(20, '2022_06_08_090758_create_excel_files_table', 1),
(21, '2022_06_08_110902_add_excel_id_to_offers_table', 1),
(23, '2022_07_07_121738_create_customer_tracks_table', 2),
(24, '2022_05_23_093505_create_subscriptions_table', 3);

-- --------------------------------------------------------

--
-- Table structure for table `notifications`
--

CREATE TABLE `notifications` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `body` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `target_type` enum('Broadcast','Categories','Cities','Gender','Stores Subscriptions') COLLATE utf8mb4_unicode_ci NOT NULL,
  `target_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;

--
-- Dumping data for table `notifications`
--

INSERT INTO `notifications` (`id`, `title`, `body`, `target_type`, `target_value`, `created_at`, `updated_at`) VALUES
(2, 'asda', 'Molestiae fugiat iuMolestiae fugiat iuMolestiae fugiat iuMolestiae fugiat iuMolestiae fugiat iuMolestiae fugiat iuMolestiae fugiat iuMolestiae fugiat iuMolestiae fugiat iuMolestiae fugiat iuMolestiae fugiat iu', 'Gender', 'Male|Female', '2022-07-07 05:24:30', '2022-07-07 05:24:30');

-- --------------------------------------------------------

--
-- Table structure for table `notification_receivers`
--

CREATE TABLE `notification_receivers` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `customer_id` bigint(20) UNSIGNED NOT NULL,
  `notification_id` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `notification_receivers`
--

INSERT INTO `notification_receivers` (`id`, `customer_id`, `notification_id`) VALUES
(1, 1, 2),
(2, 2, 2),
(3, 3, 2),
(4, 4, 2),
(5, 5, 2),
(6, 6, 2),
(7, 7, 2),
(8, 8, 2),
(9, 9, 2),
(10, 10, 2),
(11, 11, 2),
(12, 12, 2),
(13, 13, 2),
(14, 14, 2),
(15, 15, 2);

-- --------------------------------------------------------

--
-- Table structure for table `offers`
--

CREATE TABLE `offers` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `expiry_date` date DEFAULT NULL,
  `price` double(8,2) NOT NULL,
  `status` enum('On Hold','Approved','Rejected') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'On Hold',
  `description` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `reject_reason` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `offer_type_id` bigint(20) UNSIGNED NOT NULL,
  `category_id` bigint(20) UNSIGNED NOT NULL,
  `customer_id` bigint(20) UNSIGNED DEFAULT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `reviewed_by` bigint(20) UNSIGNED DEFAULT NULL,
  `reviewed_at` datetime DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `excel_id` bigint(20) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `offers`
--

INSERT INTO `offers` (`id`, `title`, `expiry_date`, `price`, `status`, `description`, `reject_reason`, `offer_type_id`, `category_id`, `customer_id`, `user_id`, `reviewed_by`, `reviewed_at`, `created_at`, `updated_at`, `excel_id`) VALUES
(1, 'توشيبا لابتوب', NULL, 245.00, 'On Hold', 'توشيبا لابتوب', NULL, 1, 2, NULL, 2, NULL, NULL, '2022-07-06 08:32:19', '2022-07-06 08:32:19', 1),
(2, 'لابتوب سامسونغ', NULL, 350.00, 'On Hold', 'asdasdsadsaasdasasdasd', NULL, 1, 1, NULL, 2, NULL, NULL, '2022-07-06 08:32:19', '2022-07-06 08:45:45', 1),
(3, 'Voluptas nulla minus', NULL, 74.00, 'On Hold', 'Reiciendis earum vel', NULL, 1, 3, NULL, 1, NULL, NULL, '2022-07-07 04:13:13', '2022-07-07 04:13:13', NULL),
(4, 'Blanditiis ut velit', NULL, 655.00, 'On Hold', 'Repellendus Non rerRepellendus Non rerRepellendus Non rerRepellendus Non rerRepellendus Non rerRepellendus Non rerRepellendus Non rerRepellendus Non rerRepellendus Non rer', NULL, 1, 1, NULL, 1, NULL, NULL, '2022-07-28 09:25:40', '2022-07-28 09:25:40', NULL),
(5, 'In voluptatem sint a', NULL, 19.00, 'On Hold', 'Voluptatibus distinc', NULL, 1, 4, NULL, 1, NULL, NULL, '2022-07-28 09:27:41', '2022-07-28 09:27:41', NULL),
(6, 'توشيبا لابتوب', NULL, 245.00, 'On Hold', 'توشيبا لابتوب', NULL, 1, 2, NULL, 2, NULL, NULL, '2022-07-31 06:36:59', '2022-07-31 06:36:59', 2),
(7, 'لابتوب سامسونغ', NULL, 350.00, 'On Hold', 'لابتوب سامسونغ', NULL, 1, 2, NULL, 2, NULL, NULL, '2022-07-31 06:36:59', '2022-07-31 06:36:59', 2),
(8, 'Eligendi sed dolorem', NULL, 300.00, 'Rejected', 'Dolore sunt aut ea a', NULL, 1, 4, NULL, 1, 1, '2022-08-03 06:35:13', '2022-08-03 03:35:04', '2022-08-03 03:35:04', NULL),
(9, 'Earum quia accusanti', NULL, 850.00, 'On Hold', 'Autem iste minim ess', NULL, 2, 2, NULL, 1, NULL, NULL, '2022-08-04 06:52:07', '2022-08-04 06:52:07', NULL),
(10, 'Aspernatur accusamus', NULL, 698.00, 'On Hold', 'Ullam aliquam animisadasd', NULL, 2, 1, NULL, 1, NULL, NULL, '2022-08-04 06:53:15', '2022-08-04 06:53:15', NULL),
(11, 'Dolore dolorem commo', NULL, 553.00, 'Approved', 'Officiis ratione min', '', 1, 2, NULL, 1, 1, '2022-09-06 11:35:18', '2022-08-04 07:00:03', '2022-08-04 07:00:03', NULL);

-- --------------------------------------------------------

--
-- Table structure for table `offer_tags`
--

CREATE TABLE `offer_tags` (
  `offer_id` bigint(20) UNSIGNED NOT NULL,
  `tag_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;

--
-- Dumping data for table `offer_tags`
--

INSERT INTO `offer_tags` (`offer_id`, `tag_id`, `created_at`, `updated_at`) VALUES
(1, 6, NULL, NULL),
(1, 7, NULL, NULL),
(1, 8, NULL, NULL),
(1, 9, NULL, NULL),
(2, 6, NULL, NULL),
(2, 7, NULL, NULL),
(2, 9, NULL, NULL),
(2, 10, NULL, NULL),
(3, 2, NULL, NULL),
(3, 3, NULL, NULL),
(3, 4, NULL, NULL),
(3, 5, NULL, NULL),
(3, 6, NULL, NULL),
(3, 8, NULL, NULL),
(4, 2, NULL, NULL),
(4, 3, NULL, NULL),
(4, 6, NULL, NULL),
(4, 7, NULL, NULL),
(4, 8, NULL, NULL),
(4, 9, NULL, NULL),
(4, 10, NULL, NULL),
(5, 2, NULL, NULL),
(5, 5, NULL, NULL),
(5, 6, NULL, NULL),
(5, 8, NULL, NULL),
(5, 9, NULL, NULL),
(5, 10, NULL, NULL),
(6, 6, NULL, NULL),
(6, 7, NULL, NULL),
(6, 8, NULL, NULL),
(6, 9, NULL, NULL),
(7, 6, NULL, NULL),
(7, 7, NULL, NULL),
(7, 9, NULL, NULL),
(7, 10, NULL, NULL),
(8, 6, NULL, NULL),
(8, 8, NULL, NULL),
(9, 6, NULL, NULL),
(10, 2, NULL, NULL),
(10, 3, NULL, NULL),
(10, 4, NULL, NULL),
(10, 7, NULL, NULL),
(10, 8, NULL, NULL),
(11, 3, NULL, NULL),
(11, 7, NULL, NULL),
(11, 8, NULL, NULL),
(11, 9, NULL, NULL);

-- --------------------------------------------------------

--
-- Table structure for table `offer_types`
--

CREATE TABLE `offer_types` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name_en` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name_pt` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `name_ar` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `price` double(8,2) NOT NULL,
  `description` text 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;

--
-- Dumping data for table `offer_types`
--

INSERT INTO `offer_types` (`id`, `name_en`, `name_pt`, `name_ar`, `price`, `description`, `created_at`, `updated_at`) VALUES
(1, 'Destini Dibbert', 'Mrs. Joanny Johns', NULL, 6051.00, 'She was a good opportunity for croqueting one of the shelves as she could. \'No,\' said the Duchess, it had entirely disappeared; so the King said to herself, \'because of his great wig.\' The judge, by.', '2022-07-06 04:30:55', '2022-07-06 04:30:55'),
(2, 'Myrtie Aufderhar', 'Sarah Hirthe', NULL, 31832.00, 'Alice, \'how am I to get very tired of this. I vote the young man said, \'And your hair has become very white; And yet I wish you wouldn\'t mind,\' said Alice: \'--where\'s the Duchess?\' \'Hush! Hush!\'.', '2022-07-06 04:30:55', '2022-07-06 04:30:55'),
(3, 'Lesley Ziemann', 'Fredrick Jenkins', NULL, 21114.00, 'WHAT things?\' said the March Hare. \'It was the fan and gloves--that is, if I like being that person, I\'ll come up: if not, I\'ll stay down here till I\'m somebody else\"--but, oh dear!\' cried Alice.', '2022-07-06 04:30:55', '2022-07-06 04:30:55');

-- --------------------------------------------------------

--
-- Table structure for table `password_resets`
--

CREATE TABLE `password_resets` (
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `personal_access_tokens`
--

CREATE TABLE `personal_access_tokens` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `tokenable_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `tokenable_id` bigint(20) 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,
  `last_used_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `stores`
--

CREATE TABLE `stores` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `logo` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cover` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('Active','Inactive','Expired') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Active',
  `expiry_date` date NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `city_id` bigint(20) UNSIGNED DEFAULT NULL,
  `user_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;

--
-- Dumping data for table `stores`
--

INSERT INTO `stores` (`id`, `name`, `logo`, `cover`, `status`, `expiry_date`, `description`, `city_id`, `user_id`, `created_at`, `updated_at`) VALUES
(1, 'Store', '1659010604_159-536x354.jpg', 'KaruJxUEslel8uCDGYDrfRIdZhobJJ9ZzReDuYst.jpg', 'Inactive', '2022-07-20', 'Libero dolor veritat', 2, 2, '2022-07-06 08:13:23', '2022-09-06 08:42:13'),
(2, 'Amelia Stanton', NULL, NULL, 'Active', '2022-08-03', 'Iste veritatis earum', 1, 3, '2022-07-28 09:21:21', '2022-08-04 07:38:36');

-- --------------------------------------------------------

--
-- Table structure for table `subscriptions`
--

CREATE TABLE `subscriptions` (
  `customer_id` bigint(20) UNSIGNED NOT NULL,
  `store_id` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `tags`
--

CREATE TABLE `tags` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tags`
--

INSERT INTO `tags` (`id`, `name`) VALUES
(1, 'Prof. Boris Sporer PhD'),
(2, 'Floyd Haley IV'),
(3, 'Prof. Russ Bogisich I'),
(4, 'Mrs. Jacinthe Emmerich MD'),
(5, 'Dr. Dock Cronin'),
(6, 'لابتوب'),
(7, 'الكترون'),
(8, 'توشيبا'),
(9, 'Laptop'),
(10, 'سامسونغ'),
(11, 'Evangeline Good');

-- --------------------------------------------------------

--
-- Table structure for table `target_areas`
--

CREATE TABLE `target_areas` (
  `offer_id` bigint(20) UNSIGNED NOT NULL,
  `city_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;

--
-- Dumping data for table `target_areas`
--

INSERT INTO `target_areas` (`offer_id`, `city_id`, `created_at`, `updated_at`) VALUES
(3, 4, NULL, NULL),
(3, 5, NULL, NULL),
(4, 4, NULL, NULL),
(5, 3, NULL, NULL),
(5, 4, NULL, NULL),
(5, 5, NULL, NULL),
(6, 2, NULL, NULL),
(6, 3, NULL, NULL),
(6, 4, NULL, NULL),
(7, 2, NULL, NULL),
(7, 3, NULL, NULL),
(7, 4, NULL, NULL),
(8, 3, NULL, NULL),
(8, 4, NULL, NULL),
(9, 2, NULL, NULL),
(9, 4, NULL, NULL),
(10, 3, NULL, NULL),
(11, 3, NULL, NULL),
(11, 4, NULL, NULL);

-- --------------------------------------------------------

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `password` varchar(255) 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,
  `role` enum('Admin','Supervisor','Store Owner') COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `users`
--

INSERT INTO `users` (`id`, `name`, `email`, `email_verified_at`, `password`, `remember_token`, `created_at`, `updated_at`, `role`, `status`) VALUES
(1, 'Admin', 'admin@test.com', NULL, '$2y$10$iWz4y4arY2Cd4GhYi2tzw.2ZhTbt2bj.3qBqaWKwSLX8PjI.kx6Ua', NULL, '2022-07-06 04:30:54', '2022-07-06 04:30:54', 'Admin', 1),
(2, 'Store Owner', 'store@test.com', NULL, '$2y$10$NuJWAGh9au9o5vAX9T9fSOEt/Ih89i2pEGwQNaTlN.o8Gc2vs8Qwm', NULL, '2022-07-06 08:13:23', '2022-09-06 08:42:13', 'Store Owner', 0),
(3, 'hafuxu', 'jipuzyheq@mailinator.com', NULL, '$2y$10$7Cvida2BM3TQ48WtW2Yui.JP1vOb7j8fdvsTySHQbaYQxtE4/ZkUe', NULL, '2022-07-28 09:21:21', '2022-07-28 09:21:21', 'Store Owner', 1),
(6, 'Juliet Chaney', 'xyle@mailinator.com', NULL, '$2y$10$hu1f5XFBhKN9CcUbgu4rtO42nh5VYzpeASyoe/JYQ5TqO3Jque.sa', NULL, '2022-09-06 08:34:02', '2022-09-06 08:41:03', 'Admin', 0);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `categories`
--
ALTER TABLE `categories`
  ADD PRIMARY KEY (`id`),
  ADD KEY `categories_parent_id_foreign` (`parent_id`);

--
-- Indexes for table `cities`
--
ALTER TABLE `cities`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `customers`
--
ALTER TABLE `customers`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `customers_email_unique` (`email`),
  ADD UNIQUE KEY `customers_phone_unique` (`phone`),
  ADD KEY `customers_city_id_foreign` (`city_id`);

--
-- Indexes for table `customers_interests`
--
ALTER TABLE `customers_interests`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `customers_interests_category_id_customer_id_unique` (`category_id`,`customer_id`),
  ADD KEY `customers_interests_customer_id_foreign` (`customer_id`);

--
-- Indexes for table `customer_tracks`
--
ALTER TABLE `customer_tracks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `customer_tracks_customer_id_foreign` (`customer_id`);

--
-- Indexes for table `excel_files`
--
ALTER TABLE `excel_files`
  ADD PRIMARY KEY (`id`),
  ADD KEY `excel_files_user_id_foreign` (`user_id`);

--
-- Indexes for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`);

--
-- Indexes for table `images`
--
ALTER TABLE `images`
  ADD PRIMARY KEY (`id`),
  ADD KEY `images_offer_id_foreign` (`offer_id`);

--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `notifications`
--
ALTER TABLE `notifications`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `notification_receivers`
--
ALTER TABLE `notification_receivers`
  ADD PRIMARY KEY (`id`),
  ADD KEY `notification_receivers_customer_id_foreign` (`customer_id`),
  ADD KEY `notification_receivers_notification_id_foreign` (`notification_id`);

--
-- Indexes for table `offers`
--
ALTER TABLE `offers`
  ADD PRIMARY KEY (`id`),
  ADD KEY `offers_offer_type_id_foreign` (`offer_type_id`),
  ADD KEY `offers_category_id_foreign` (`category_id`),
  ADD KEY `offers_customer_id_foreign` (`customer_id`),
  ADD KEY `offers_user_id_foreign` (`user_id`),
  ADD KEY `offers_reviewed_by_foreign` (`reviewed_by`),
  ADD KEY `offers_excel_id_foreign` (`excel_id`);

--
-- Indexes for table `offer_tags`
--
ALTER TABLE `offer_tags`
  ADD PRIMARY KEY (`offer_id`,`tag_id`),
  ADD KEY `offer_tags_tag_id_foreign` (`tag_id`);

--
-- Indexes for table `offer_types`
--
ALTER TABLE `offer_types`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `password_resets`
--
ALTER TABLE `password_resets`
  ADD KEY `password_resets_email_index` (`email`);

--
-- Indexes for table `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`);

--
-- Indexes for table `stores`
--
ALTER TABLE `stores`
  ADD PRIMARY KEY (`id`),
  ADD KEY `stores_city_id_foreign` (`city_id`),
  ADD KEY `stores_user_id_foreign` (`user_id`);

--
-- Indexes for table `subscriptions`
--
ALTER TABLE `subscriptions`
  ADD PRIMARY KEY (`customer_id`,`store_id`),
  ADD KEY `subscriptions_store_id_foreign` (`store_id`);

--
-- Indexes for table `tags`
--
ALTER TABLE `tags`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `target_areas`
--
ALTER TABLE `target_areas`
  ADD PRIMARY KEY (`offer_id`,`city_id`),
  ADD KEY `target_areas_city_id_foreign` (`city_id`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `users_email_unique` (`email`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `categories`
--
ALTER TABLE `categories`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `cities`
--
ALTER TABLE `cities`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `customers`
--
ALTER TABLE `customers`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;

--
-- AUTO_INCREMENT for table `customers_interests`
--
ALTER TABLE `customers_interests`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `customer_tracks`
--
ALTER TABLE `customer_tracks`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `excel_files`
--
ALTER TABLE `excel_files`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `images`
--
ALTER TABLE `images`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;

--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25;

--
-- AUTO_INCREMENT for table `notifications`
--
ALTER TABLE `notifications`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `notification_receivers`
--
ALTER TABLE `notification_receivers`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;

--
-- AUTO_INCREMENT for table `offers`
--
ALTER TABLE `offers`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

--
-- AUTO_INCREMENT for table `offer_types`
--
ALTER TABLE `offer_types`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `personal_access_tokens`
--
ALTER TABLE `personal_access_tokens`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `stores`
--
ALTER TABLE `stores`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `tags`
--
ALTER TABLE `tags`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `categories`
--
ALTER TABLE `categories`
  ADD CONSTRAINT `categories_parent_id_foreign` FOREIGN KEY (`parent_id`) REFERENCES `categories` (`id`);

--
-- Constraints for table `customers`
--
ALTER TABLE `customers`
  ADD CONSTRAINT `customers_city_id_foreign` FOREIGN KEY (`city_id`) REFERENCES `cities` (`id`);

--
-- Constraints for table `customers_interests`
--
ALTER TABLE `customers_interests`
  ADD CONSTRAINT `customers_interests_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customers_interests_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `customer_tracks`
--
ALTER TABLE `customer_tracks`
  ADD CONSTRAINT `customer_tracks_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `excel_files`
--
ALTER TABLE `excel_files`
  ADD CONSTRAINT `excel_files_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `images`
--
ALTER TABLE `images`
  ADD CONSTRAINT `images_offer_id_foreign` FOREIGN KEY (`offer_id`) REFERENCES `offers` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `notification_receivers`
--
ALTER TABLE `notification_receivers`
  ADD CONSTRAINT `notification_receivers_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `notification_receivers_notification_id_foreign` FOREIGN KEY (`notification_id`) REFERENCES `notifications` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `offers`
--
ALTER TABLE `offers`
  ADD CONSTRAINT `offers_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`),
  ADD CONSTRAINT `offers_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`),
  ADD CONSTRAINT `offers_excel_id_foreign` FOREIGN KEY (`excel_id`) REFERENCES `excel_files` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `offers_offer_type_id_foreign` FOREIGN KEY (`offer_type_id`) REFERENCES `offer_types` (`id`),
  ADD CONSTRAINT `offers_reviewed_by_foreign` FOREIGN KEY (`reviewed_by`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `offers_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `offer_tags`
--
ALTER TABLE `offer_tags`
  ADD CONSTRAINT `offer_tags_offer_id_foreign` FOREIGN KEY (`offer_id`) REFERENCES `offers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `offer_tags_tag_id_foreign` FOREIGN KEY (`tag_id`) REFERENCES `tags` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `stores`
--
ALTER TABLE `stores`
  ADD CONSTRAINT `stores_city_id_foreign` FOREIGN KEY (`city_id`) REFERENCES `cities` (`id`),
  ADD CONSTRAINT `stores_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `subscriptions`
--
ALTER TABLE `subscriptions`
  ADD CONSTRAINT `subscriptions_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `subscriptions_store_id_foreign` FOREIGN KEY (`store_id`) REFERENCES `stores` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `target_areas`
--
ALTER TABLE `target_areas`
  ADD CONSTRAINT `target_areas_city_id_foreign` FOREIGN KEY (`city_id`) REFERENCES `cities` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `target_areas_offer_id_foreign` FOREIGN KEY (`offer_id`) REFERENCES `offers` (`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 */;
