-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- 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 `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 `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);

--
-- 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 `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 `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`);

--
-- 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 `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 `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;

--
-- 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 `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;

