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

START TRANSACTION;



--
-- Database: `tprportal`
--

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

--
-- Table structure for table `activity_log`
--

CREATE TABLE `activity_log` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `log_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `subject_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `subject_id` bigint(20) UNSIGNED DEFAULT NULL,
  `causer_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `causer_id` bigint(20) UNSIGNED DEFAULT NULL,
  `properties` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`properties`)),
  `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 `activity_log`
--

INSERT INTO `activity_log` (`id`, `log_name`, `description`, `subject_type`, `subject_id`, `causer_type`, `causer_id`, `properties`, `created_at`, `updated_at`) VALUES
(1, 'default', 'login', 'App\\User', 1, 'App\\User', 1, '{\"attributes\":{\"ip\":\"127.0.0.1\",\"browser\":\"Chrome\"}}', '2022-07-07 22:42:28', '2022-07-07 22:42:28'),
(2, 'default', 'login', 'App\\User', 1, 'App\\User', 1, '{\"attributes\":{\"ip\":\"127.0.0.1\",\"browser\":\"Chrome\"}}', '2022-07-07 23:21:00', '2022-07-07 23:21:00'),
(3, 'default', 'login', 'App\\User', 1, 'App\\User', 1, '{\"attributes\":{\"ip\":\"127.0.0.1\",\"browser\":\"Chrome\"}}', '2022-07-12 13:49:41', '2022-07-12 13:49:41'),
(4, 'default', 'created', 'App\\Lead', 1, 'App\\User', 1, '{\"attributes\":{\"status.title\":\"Pending\",\"department.title\":null,\"id\":1,\"first_name\":\"George\",\"last_name\":\"Foster\",\"company\":\"Top Page Rankers, INC\",\"email\":\"george@toppagerankers.com\",\"phone\":\"832-906-3010\",\"description\":\"testing lead\",\"department_id\":null,\"lead_status_id\":1,\"created_by\":1,\"lead_status\":\"Lead\",\"closer_id\":null,\"created_at\":\"2022-07-12T11:52:52.000000Z\",\"updated_at\":\"2022-07-12T11:52:52.000000Z\",\"follow_up\":\"2022-07-12T15:00:00.000000Z\",\"company_phone\":\"832-906-3010\",\"company_email\":\"george@toppagerankers.com\",\"company_website\":\"toppagerankers.com\",\"targeted_keywords\":\"roofing\",\"targeted_radius\":\"25\",\"yelp_profile\":\"HTTPS:\\/\\/WWW.YELP.COM\",\"transfer_date\":null,\"campaign_created_at\":null}}', '2022-07-12 14:52:52', '2022-07-12 14:52:52'),
(5, 'default', 'updated', 'App\\Lead', 1, 'App\\User', 1, '{\"attributes\":{\"lead_status\":\"Transferred\",\"closer_id\":2,\"updated_at\":\"2022-07-12T16:27:14.000000Z\",\"transfer_date\":\"2022-07-12\"},\"old\":{\"lead_status\":\"Lead\",\"closer_id\":null,\"updated_at\":\"2022-07-12T11:52:52.000000Z\",\"transfer_date\":null}}', '2022-07-12 19:27:14', '2022-07-12 19:27:14'),
(6, 'default', 'login', 'App\\User', 1, 'App\\User', 1, '{\"attributes\":{\"ip\":\"127.0.0.1\",\"browser\":\"Chrome\"}}', '2022-07-16 23:04:00', '2022-07-16 23:04:00'),
(7, 'default', 'login', 'App\\User', 1, 'App\\User', 1, '{\"attributes\":{\"ip\":\"127.0.0.1\",\"browser\":\"Chrome\"}}', '2022-07-17 10:23:39', '2022-07-17 10:23:39'),
(8, 'default', 'login', 'App\\User', 1, 'App\\User', 1, '{\"attributes\":{\"ip\":\"127.0.0.1\",\"browser\":\"Chrome\"}}', '2022-07-19 03:03:35', '2022-07-19 03:03:35'),
(9, 'default', 'created', 'App\\Customer', 1, 'App\\User', 1, '{\"attributes\":{\"id\":1,\"name\":\"talha\",\"company\":\"Top Page Rankers, INC\",\"title\":null,\"first_name\":null,\"middle_name\":null,\"last_name\":null,\"phone_1\":\"033 203 2329\",\"phone_2\":\"032 298 3899\",\"fax\":null,\"email\":\"talhachughtai10@gmail.com\",\"website\":null,\"address\":\"testing compaign\",\"country\":\"Pakistan\",\"city\":\"Sialkot\",\"state\":\"punjab\",\"zip\":\"8909\",\"created_by\":1,\"created_at\":\"2022-07-19T00:14:46.000000Z\",\"updated_at\":\"2022-07-19T00:14:46.000000Z\",\"status\":\"Pre-Active\",\"status_reason\":null,\"status_datetime\":null,\"targeted_keywords\":null,\"targeted_radius\":null,\"yelp_profile\":null,\"description\":\"testing description\"}}', '2022-07-19 03:14:47', '2022-07-19 03:14:47'),
(10, 'default', 'created', 'App\\Campaign', 1, 'App\\User', 1, '{\"attributes\":{\"status.title\":\"active\",\"salesAgent.name\":\"Super Admin\",\"supportAgent.name\":null,\"id\":1,\"customer_id\":1,\"status_id\":1,\"title\":\"testing\",\"website\":\"testing.com\",\"due_date\":\"2022-07-29T04:00:00.000000Z\",\"type\":\"One Time\",\"description\":\"<p>testing<\\/p>\",\"sales_agent_id\":1,\"support_agent_id\":null,\"support_agent_assigned_date\":null,\"created_by\":1,\"created_at\":\"2022-07-19T00:18:02.000000Z\",\"updated_at\":\"2022-07-19T00:18:02.000000Z\",\"targeted_cities\":\"lahore\",\"targeted_services\":\"roofing services\",\"payment_method\":\"PayPal\",\"card_type\":null,\"card_number\":null,\"card_expire\":null,\"card_holder\":null,\"billing_address\":\"d block\",\"closer_note\":\"testing\",\"campaign_status\":\"Pre-Active\",\"lead_id\":1,\"flagged_status\":0,\"flagged_note\":null,\"flagged_datetime\":null,\"targeted_keywords\":\"roofing\",\"targeted_radius\":\"25\",\"yelp_profile\":\"HTTPS:\\/\\/WWW.YELP.COM\",\"payment_date\":null,\"login\":null,\"gmp_listing_address\":null,\"listing_status\":\"No\",\"listing_access\":\"No\",\"access_email\":null,\"credential_email\":null,\"credential_password\":null}}', '2022-07-19 03:18:02', '2022-07-19 03:18:02'),
(11, 'default', 'updated', 'App\\Lead', 1, 'App\\User', 1, '{\"attributes\":{\"lead_status\":\"Active\",\"updated_at\":\"2022-07-19T00:18:02.000000Z\",\"campaign_created_at\":\"2022-07-18\"},\"old\":{\"lead_status\":\"Transferred\",\"updated_at\":\"2022-07-12T16:27:14.000000Z\",\"campaign_created_at\":null}}', '2022-07-19 03:18:02', '2022-07-19 03:18:02'),
(12, 'default', 'login', 'App\\User', 1, 'App\\User', 1, '{\"attributes\":{\"ip\":\"127.0.0.1\",\"browser\":\"Chrome\"}}', '2022-07-21 07:21:11', '2022-07-21 07:21:11'),
(13, 'default', 'login', 'App\\User', 1, 'App\\User', 1, '{\"attributes\":{\"ip\":\"127.0.0.1\",\"browser\":\"Chrome\"}}', '2022-07-22 13:38:22', '2022-07-22 13:38:22'),
(14, 'default', 'login', 'App\\User', 1, 'App\\User', 1, '{\"attributes\":{\"ip\":\"127.0.0.1\",\"browser\":\"Chrome\"}}', '2022-07-23 21:12:59', '2022-07-23 21:12:59'),
(15, 'default', 'created', 'App\\Lead', 2, 'App\\User', 1, '{\"attributes\":{\"status.title\":\"Pending\",\"department.title\":null,\"id\":2,\"first_name\":\"George\",\"last_name\":\"Foster\",\"company\":\"Top Page Rankers, INC\",\"email\":\"george@toppagerankers.com\",\"phone\":\"1112223333\",\"description\":\"testing note\",\"department_id\":null,\"lead_status_id\":1,\"created_by\":1,\"lead_status\":\"Lead\",\"closer_id\":null,\"created_at\":\"2022-07-23T18:16:09.000000Z\",\"updated_at\":\"2022-07-23T18:16:09.000000Z\",\"follow_up\":\"2022-07-14T16:00:00.000000Z\",\"company_phone\":\"1112223333\",\"company_email\":\"george@toppagerankers.com\",\"company_website\":\"toppagerankers.com\",\"targeted_keywords\":\"contractors\",\"targeted_radius\":\"30\",\"yelp_profile\":\"HTTPS:\\/\\/WWW.YELP.COM\",\"transfer_date\":null,\"campaign_created_at\":null}}', '2022-07-23 21:16:09', '2022-07-23 21:16:09'),
(16, 'default', 'updated', 'App\\Customer', 1, 'App\\User', 1, '{\"attributes\":{\"updated_at\":\"2022-07-23T20:56:48.000000Z\",\"status\":\"Active\",\"status_datetime\":\"2022-07-23T20:56:48.000000Z\"},\"old\":{\"updated_at\":\"2022-07-19T00:14:46.000000Z\",\"status\":\"Pre-Active\",\"status_datetime\":null}}', '2022-07-23 23:56:48', '2022-07-23 23:56:48'),
(17, 'default', 'created', 'App\\Customer', 2, 'App\\User', 1, '{\"attributes\":{\"id\":2,\"name\":\"ben martin\",\"company\":\"tpr\",\"title\":null,\"first_name\":null,\"middle_name\":null,\"last_name\":null,\"phone_1\":\"239029302\",\"phone_2\":null,\"fax\":null,\"email\":\"ben@toppagerankers.com\",\"website\":\"toppagerankers.com\",\"address\":\"testing\",\"country\":\"pakistan\",\"city\":\"lahore\",\"state\":\"punjab\",\"zip\":\"23902\",\"created_by\":1,\"created_at\":\"2022-07-23T20:58:43.000000Z\",\"updated_at\":\"2022-07-23T20:58:43.000000Z\",\"status\":\"Active\",\"status_reason\":null,\"status_datetime\":null,\"targeted_keywords\":null,\"targeted_radius\":null,\"yelp_profile\":null,\"description\":\"testing\"}}', '2022-07-23 23:58:43', '2022-07-23 23:58:43'),
(18, 'default', 'login', 'App\\User', 1, 'App\\User', 1, '{\"attributes\":{\"ip\":\"127.0.0.1\",\"browser\":\"Chrome\"}}', '2022-07-24 20:11:47', '2022-07-24 20:11:47'),
(19, 'default', 'created', 'App\\Customer', 3, 'App\\User', 1, '{\"attributes\":{\"id\":3,\"name\":\"zack\",\"company\":\"Top Page Rankers, INC\",\"title\":null,\"first_name\":null,\"middle_name\":null,\"last_name\":null,\"phone_1\":\"909 393 3930\",\"phone_2\":\"032 298 3899\",\"fax\":null,\"email\":\"zack@toppagerankers.com\",\"website\":\"toppagerankers.com\",\"address\":\"Q-Block Johar Town\",\"country\":\"Pakistan\",\"city\":\"Lahore\",\"state\":\"Punjab\",\"zip\":\"23902\",\"created_by\":1,\"created_at\":\"2022-07-24T18:03:36.000000Z\",\"updated_at\":\"2022-07-24T18:03:36.000000Z\",\"status\":\"Pre-Active\",\"status_reason\":null,\"status_datetime\":null,\"targeted_keywords\":null,\"targeted_radius\":null,\"yelp_profile\":null,\"description\":\"testing project note\"}}', '2022-07-24 21:03:36', '2022-07-24 21:03:36'),
(20, 'default', 'updated', 'App\\Customer', 2, 'App\\User', 1, '{\"attributes\":{\"updated_at\":\"2022-07-24T18:09:23.000000Z\",\"status\":\"De-Activate\",\"status_datetime\":\"2022-07-24T18:09:23.000000Z\"},\"old\":{\"updated_at\":\"2022-07-23T20:58:43.000000Z\",\"status\":\"Active\",\"status_datetime\":null}}', '2022-07-24 21:09:23', '2022-07-24 21:09:23'),
(21, 'default', 'login', 'App\\User', 3, 'App\\User', 3, '{\"attributes\":{\"ip\":\"127.0.0.1\",\"browser\":\"Chrome\"}}', '2022-07-24 23:56:01', '2022-07-24 23:56:01'),
(22, 'default', 'login', 'App\\User', 1, 'App\\User', 1, '{\"attributes\":{\"ip\":\"127.0.0.1\",\"browser\":\"Chrome\"}}', '2022-07-24 23:56:24', '2022-07-24 23:56:24'),
(23, 'default', 'login', 'App\\User', 3, 'App\\User', 3, '{\"attributes\":{\"ip\":\"127.0.0.1\",\"browser\":\"Chrome\"}}', '2022-07-24 23:56:39', '2022-07-24 23:56:39'),
(24, 'default', 'login', 'App\\User', 1, 'App\\User', 1, '{\"attributes\":{\"ip\":\"127.0.0.1\",\"browser\":\"Chrome\"}}', '2022-07-27 05:57:14', '2022-07-27 05:57:14'),
(25, 'default', 'login', 'App\\User', 1, 'App\\User', 1, '{\"attributes\":{\"ip\":\"127.0.0.1\",\"browser\":\"Chrome\"}}', '2022-07-31 06:58:04', '2022-07-31 06:58:04'),
(26, 'default', 'login', 'App\\User', 1, 'App\\User', 1, '{\"attributes\":{\"ip\":\"127.0.0.1\",\"browser\":\"Chrome\"}}', '2022-08-02 10:41:40', '2022-08-02 10:41:40'),
(27, 'default', 'created', 'App\\Lead', 3, 'App\\User', 1, '{\"attributes\":{\"status.title\":\"Pending\",\"department.title\":null,\"id\":3,\"first_name\":\"Hameez\",\"last_name\":\"Tariq\",\"company\":\"garage door company\",\"email\":\"hameez@gmail.com\",\"phone\":\"2322322333\",\"description\":\"testing project\",\"department_id\":null,\"lead_status_id\":1,\"created_by\":1,\"lead_status\":\"Lead\",\"closer_id\":null,\"created_at\":\"2022-08-02T09:41:09.000000Z\",\"updated_at\":\"2022-08-02T09:41:09.000000Z\",\"follow_up\":\"2022-08-10T19:00:00.000000Z\",\"company_phone\":\"(232) 323-232\",\"company_email\":\"garagedoor@gmail.com\",\"company_website\":\"garagedoor.com\",\"targeted_keywords\":\"garage door,doors\",\"targeted_radius\":\"30\",\"yelp_profile\":\"HTTPS:\\/\\/WWW.YELP.COM\",\"transfer_date\":null,\"campaign_created_at\":null}}', '2022-08-02 12:41:09', '2022-08-02 12:41:09'),
(28, 'default', 'updated', 'App\\Lead', 3, 'App\\User', 1, '{\"attributes\":{\"phone\":\"(324) 983-8999\",\"updated_at\":\"2022-08-02T09:45:14.000000Z\"},\"old\":{\"phone\":\"2322322333\",\"updated_at\":\"2022-08-02T09:41:09.000000Z\"}}', '2022-08-02 12:45:14', '2022-08-02 12:45:14'),
(29, 'default', 'created', 'App\\Customer', 4, 'App\\User', 1, '{\"attributes\":{\"id\":4,\"name\":\"Hameez Tariq\",\"company\":\"garage door\",\"title\":null,\"first_name\":null,\"middle_name\":null,\"last_name\":null,\"phone_1\":\"(555) 232-3002\",\"phone_2\":\"(888) 999-9771\",\"fax\":null,\"email\":\"hameez@gmail.com\",\"website\":\"garagedoor.com\",\"address\":\"Q block\",\"country\":\"Pakistan\",\"city\":\"lahore\",\"state\":\"Punjab\",\"zip\":\"23902\",\"created_by\":1,\"created_at\":\"2022-08-02T10:10:57.000000Z\",\"updated_at\":\"2022-08-02T10:10:57.000000Z\",\"status\":\"Active\",\"status_reason\":null,\"status_datetime\":null,\"targeted_keywords\":null,\"targeted_radius\":null,\"yelp_profile\":null,\"description\":\"testing project\"}}', '2022-08-02 13:10:57', '2022-08-02 13:10:57'),
(30, 'default', 'created', 'App\\Customer', 5, 'App\\User', 1, '{\"attributes\":{\"id\":5,\"name\":\"usman\",\"company\":\"Tour Guide\",\"title\":null,\"first_name\":null,\"middle_name\":null,\"last_name\":null,\"phone_1\":\"(222) 222-2221\",\"phone_2\":\"(122) 222-2222\",\"fax\":null,\"email\":\"tourguide@gmail.com\",\"website\":\"tourguide.com\",\"address\":\"USA\",\"country\":\"USA\",\"city\":\"New York\",\"state\":\"Texas\",\"zip\":\"90880\",\"created_by\":1,\"created_at\":\"2022-08-02T10:25:51.000000Z\",\"updated_at\":\"2022-08-02T10:25:51.000000Z\",\"status\":\"Pre-Active\",\"status_reason\":null,\"status_datetime\":null,\"targeted_keywords\":null,\"targeted_radius\":null,\"yelp_profile\":null,\"description\":\"test\"}}', '2022-08-02 13:25:51', '2022-08-02 13:25:51'),
(31, 'default', 'created', 'App\\Campaign', 2, 'App\\User', 1, '{\"attributes\":{\"status.title\":\"active\",\"salesAgent.name\":null,\"supportAgent.name\":null,\"id\":2,\"customer_id\":5,\"status_id\":1,\"title\":\"Tour Guide\",\"website\":\"tourguide.com\",\"due_date\":\"2022-08-30T04:00:00.000000Z\",\"type\":\"One Time\",\"description\":\"<p>test<\\/p>\",\"sales_agent_id\":null,\"support_agent_id\":null,\"support_agent_assigned_date\":null,\"created_by\":1,\"created_at\":\"2022-08-02T10:27:21.000000Z\",\"updated_at\":\"2022-08-02T10:27:21.000000Z\",\"targeted_cities\":\"usa\",\"targeted_services\":\"tour\",\"payment_method\":\"PayPal\",\"card_type\":null,\"card_number\":null,\"card_expire\":null,\"card_holder\":null,\"billing_address\":\"d block\",\"closer_note\":\"test\",\"campaign_status\":\"Pre-Active\",\"lead_id\":null,\"flagged_status\":0,\"flagged_note\":null,\"flagged_datetime\":null,\"targeted_keywords\":\"guide\",\"targeted_radius\":\"30\",\"yelp_profile\":\"HTTPS:\\/\\/WWW.YELP.COM\",\"payment_date\":null,\"login\":null,\"gmp_listing_address\":null,\"listing_status\":\"No\",\"listing_access\":\"No\",\"access_email\":null,\"credential_email\":null,\"credential_password\":null}}', '2022-08-02 13:27:21', '2022-08-02 13:27:21'),
(32, 'default', 'login', 'App\\User', 4, 'App\\User', 4, '{\"attributes\":{\"ip\":\"127.0.0.1\",\"browser\":\"Chrome\"}}', '2022-08-02 14:31:12', '2022-08-02 14:31:12'),
(33, 'default', 'login', 'App\\User', 1, 'App\\User', 1, '{\"attributes\":{\"ip\":\"127.0.0.1\",\"browser\":\"Chrome\"}}', '2022-08-02 14:34:54', '2022-08-02 14:34:54'),
(34, 'default', 'login', 'App\\User', 1, 'App\\User', 1, '{\"attributes\":{\"ip\":\"127.0.0.1\",\"browser\":\"Chrome\"}}', '2022-08-04 03:34:32', '2022-08-04 03:34:32'),
(35, 'default', 'login', 'App\\User', 4, 'App\\User', 4, '{\"attributes\":{\"ip\":\"127.0.0.1\",\"browser\":\"Edge\"}}', '2022-08-04 03:38:07', '2022-08-04 03:38:07'),
(36, 'default', 'updated', 'App\\Campaign', 2, 'App\\User', 1, '{\"attributes\":{\"updated_at\":\"2022-08-04T00:40:25.000000Z\",\"flagged_status\":1,\"flagged_note\":\"test\",\"flagged_datetime\":\"2022-08-04T00:40:25.000000Z\"},\"old\":{\"updated_at\":\"2022-08-02T10:27:21.000000Z\",\"flagged_status\":0,\"flagged_note\":null,\"flagged_datetime\":null}}', '2022-08-04 03:40:25', '2022-08-04 03:40:25'),
(37, 'default', 'updated', 'App\\Campaign', 2, 'App\\User', 1, '{\"attributes\":{\"updated_at\":\"2022-08-04T00:41:22.000000Z\",\"flagged_status\":0,\"flagged_datetime\":null},\"old\":{\"updated_at\":\"2022-08-04T00:40:25.000000Z\",\"flagged_status\":1,\"flagged_datetime\":\"2022-08-04T00:40:25.000000Z\"}}', '2022-08-04 03:41:22', '2022-08-04 03:41:22'),
(38, 'default', 'login', 'App\\User', 1, 'App\\User', 1, '{\"attributes\":{\"ip\":\"127.0.0.1\",\"browser\":\"Chrome\"}}', '2022-08-04 14:05:52', '2022-08-04 14:05:52'),
(39, 'default', 'login', 'App\\User', 1, 'App\\User', 1, '{\"attributes\":{\"ip\":\"127.0.0.1\",\"browser\":\"Chrome\"}}', '2022-08-14 09:56:29', '2022-08-14 09:56:29'),
(40, 'default', 'login', 'App\\User', 1, 'App\\User', 1, '{\"attributes\":{\"ip\":\"127.0.0.1\",\"browser\":\"Chrome\"}}', '2022-08-16 00:23:29', '2022-08-16 00:23:29'),
(41, 'default', 'login', 'App\\User', 1, 'App\\User', 1, '{\"attributes\":{\"ip\":\"127.0.0.1\",\"browser\":\"Chrome\"}}', '2022-08-22 08:06:48', '2022-08-22 08:06:48'),
(42, 'default', 'login', 'App\\User', 1, 'App\\User', 1, '{\"attributes\":{\"ip\":\"127.0.0.1\",\"browser\":\"Chrome\"}}', '2022-08-22 08:16:06', '2022-08-22 08:16:06'),
(43, 'default', 'login', 'App\\User', 1, 'App\\User', 1, '{\"attributes\":{\"ip\":\"127.0.0.1\",\"browser\":\"Chrome\"}}', '2022-08-22 08:18:19', '2022-08-22 08:18:19'),
(44, 'default', 'login', 'App\\User', 1, 'App\\User', 1, '{\"attributes\":{\"ip\":\"127.0.0.1\",\"browser\":\"Chrome\"}}', '2022-08-22 08:23:19', '2022-08-22 08:23:19'),
(45, 'default', 'login', 'App\\User', 6, 'App\\User', 6, '{\"attributes\":{\"ip\":\"127.0.0.1\",\"browser\":\"Chrome\"}}', '2022-08-22 08:25:14', '2022-08-22 08:25:14');

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

--
-- Table structure for table `announcements`
--

CREATE TABLE `announcements` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_by` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `announcement_department`
--

CREATE TABLE `announcement_department` (
  `announcement_id` bigint(20) UNSIGNED DEFAULT NULL,
  `department_id` bigint(20) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `articles`
--

CREATE TABLE `articles` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `category_id` bigint(20) UNSIGNED DEFAULT NULL,
  `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `body` longtext 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;

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

--
-- Table structure for table `article_sub_category`
--

CREATE TABLE `article_sub_category` (
  `article_id` bigint(20) UNSIGNED NOT NULL,
  `sub_category_id` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `attendances`
--

CREATE TABLE `attendances` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `clock_in` datetime DEFAULT NULL,
  `clock_out` datetime DEFAULT NULL,
  `type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `minutes` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `attendances`
--

INSERT INTO `attendances` (`id`, `user_id`, `clock_in`, `clock_out`, `type`, `description`, `minutes`) VALUES
(1, 1, '2022-07-07 16:21:53', NULL, NULL, NULL, NULL);

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

--
-- Table structure for table `attendance_types`
--

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

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

--
-- Table structure for table `campaign_command`
--

CREATE TABLE `campaign_command` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `campaign_id` bigint(20) UNSIGNED DEFAULT NULL,
  `service_id` bigint(20) UNSIGNED DEFAULT NULL,
  `command_id` bigint(20) UNSIGNED DEFAULT NULL,
  `tech_id` bigint(20) UNSIGNED DEFAULT NULL,
  `tech_assign_date` date DEFAULT '2022-07-07',
  `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `price` int(11) DEFAULT 0,
  `description` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `note` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `due_date` date DEFAULT NULL,
  `due_time` time DEFAULT NULL,
  `end_date` date DEFAULT NULL,
  `completion_note` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `department_id` bigint(20) UNSIGNED DEFAULT NULL,
  `department_assign_date` date DEFAULT '2022-07-07'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `campaign_followups`
--

CREATE TABLE `campaign_followups` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `campaign_id` bigint(20) UNSIGNED DEFAULT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `note` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `type` 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;

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

--
-- Table structure for table `campaign_notes`
--

CREATE TABLE `campaign_notes` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `campaign_id` bigint(20) UNSIGNED DEFAULT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `note` 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;

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

--
-- Table structure for table `campaign_payments`
--

CREATE TABLE `campaign_payments` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `campaign_id` bigint(20) UNSIGNED DEFAULT NULL,
  `amount` int(11) DEFAULT 0,
  `note` 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;

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

--
-- Table structure for table `campaign_reminders`
--

CREATE TABLE `campaign_reminders` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `campaign_id` bigint(20) UNSIGNED DEFAULT NULL,
  `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `due_date` date DEFAULT NULL,
  `is_triggered` tinyint(1) DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `time` time DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `campaign_service`
--

CREATE TABLE `campaign_service` (
  `campaign_id` bigint(20) UNSIGNED DEFAULT NULL,
  `service_id` bigint(20) UNSIGNED DEFAULT NULL,
  `price` int(11) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `campaign_statuses`
--

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

--
-- Dumping data for table `campaign_statuses`
--

INSERT INTO `campaign_statuses` (`id`, `title`, `color`) VALUES
(1, 'active', '#67c360');

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

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

CREATE TABLE `categories` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `title` varchar(255) 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 `conversations`
--

CREATE TABLE `conversations` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `uid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `subject` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT 'message',
  `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 `customers`
--

CREATE TABLE `customers` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `company` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `first_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `middle_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone_1` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone_2` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `fax` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `website` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `country` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `city` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `state` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `zip` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_by` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `status` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT 'Pre-Active',
  `status_reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status_datetime` datetime DEFAULT NULL,
  `targeted_keywords` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `targeted_radius` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `yelp_profile` 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;

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

INSERT INTO `customers` (`id`, `name`, `company`, `title`, `first_name`, `middle_name`, `last_name`, `phone_1`, `phone_2`, `fax`, `email`, `website`, `address`, `country`, `city`, `state`, `zip`, `created_by`, `created_at`, `updated_at`, `status`, `status_reason`, `status_datetime`, `targeted_keywords`, `targeted_radius`, `yelp_profile`, `description`) VALUES
(1, 'talha', 'Top Page Rankers, INC', NULL, NULL, NULL, NULL, '033 203 2329', '032 298 3899', NULL, 'talhachughtai10@gmail.com', NULL, 'testing compaign', 'Pakistan', 'Sialkot', 'punjab', '8909', 1, '2022-07-19 03:14:46', '2022-07-23 23:56:48', 'Active', NULL, '2022-07-23 16:56:48', NULL, NULL, NULL, 'testing description'),
(2, 'ben martin', 'tpr', NULL, NULL, NULL, NULL, '239029302', NULL, NULL, 'ben@toppagerankers.com', 'toppagerankers.com', 'testing', 'pakistan', 'lahore', 'punjab', '23902', 1, '2022-07-23 23:58:43', '2022-07-24 21:09:23', 'De-Activate', NULL, '2022-07-24 14:09:23', NULL, NULL, NULL, 'testing'),
(3, 'zack', 'Top Page Rankers, INC', NULL, NULL, NULL, NULL, '909 393 3930', '032 298 3899', NULL, 'zack@toppagerankers.com', 'toppagerankers.com', 'Q-Block Johar Town', 'Pakistan', 'Lahore', 'Punjab', '23902', 1, '2022-07-24 21:03:36', '2022-07-24 21:03:36', 'Pre-Active', NULL, NULL, NULL, NULL, NULL, 'testing project note'),
(4, 'Hameez Tariq', 'garage door', NULL, NULL, NULL, NULL, '(555) 232-3002', '(888) 999-9771', NULL, 'hameez@gmail.com', 'garagedoor.com', 'Q block', 'Pakistan', 'lahore', 'Punjab', '23902', 1, '2022-08-02 13:10:57', '2022-08-02 13:10:57', 'Active', NULL, NULL, NULL, NULL, NULL, 'testing project'),
(5, 'usman', 'Tour Guide', NULL, NULL, NULL, NULL, '(222) 222-2221', '(122) 222-2222', NULL, 'tourguide@gmail.com', 'tourguide.com', 'USA', 'USA', 'New York', 'Texas', '90880', 1, '2022-08-02 13:25:51', '2022-08-02 13:25:51', 'Pre-Active', NULL, NULL, NULL, NULL, NULL, 'test');

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

--
-- Table structure for table `departments`
--

CREATE TABLE `departments` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `title` 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;

--
-- Dumping data for table `departments`
--

INSERT INTO `departments` (`id`, `title`, `created_at`, `updated_at`) VALUES
(1, 'Closure', '2022-07-12 19:28:14', '2022-07-12 19:28:14'),
(2, 'Coordinator', '2022-07-31 18:06:07', '2022-07-31 18:06:07'),
(3, 'Quality Assurance', '2022-08-02 14:28:36', '2022-08-02 14:28:36');

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

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

CREATE TABLE `failed_jobs` (
  `id` bigint(20) UNSIGNED 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 `leads`
--

CREATE TABLE `leads` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `first_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `company` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `department_id` bigint(20) UNSIGNED DEFAULT NULL,
  `lead_status_id` bigint(20) UNSIGNED DEFAULT NULL,
  `created_by` bigint(20) UNSIGNED DEFAULT NULL,
  `lead_status` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT 'Lead',
  `closer_id` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `follow_up` datetime DEFAULT NULL,
  `company_phone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `company_email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `company_website` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `targeted_keywords` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `targeted_radius` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `yelp_profile` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `transfer_date` date DEFAULT NULL,
  `campaign_created_at` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `leads`
--

INSERT INTO `leads` (`id`, `first_name`, `last_name`, `company`, `email`, `phone`, `description`, `department_id`, `lead_status_id`, `created_by`, `lead_status`, `closer_id`, `created_at`, `updated_at`, `follow_up`, `company_phone`, `company_email`, `company_website`, `targeted_keywords`, `targeted_radius`, `yelp_profile`, `transfer_date`, `campaign_created_at`) VALUES
(1, 'George', 'Foster', 'Top Page Rankers, INC', 'george@toppagerankers.com', '832-906-3010', 'testing lead', NULL, 1, 1, 'Active', 2, '2022-07-12 14:52:52', '2022-07-19 03:18:02', '2022-07-12 11:00:00', '832-906-3010', 'george@toppagerankers.com', 'toppagerankers.com', 'roofing', '25', 'HTTPS://WWW.YELP.COM', '2022-07-12', '2022-07-18'),
(2, 'George', 'Foster', 'Top Page Rankers, INC', 'george@toppagerankers.com', '1112223333', 'testing note', NULL, 1, 1, 'Lead', NULL, '2022-07-23 21:16:09', '2022-07-23 21:16:09', '2022-07-14 12:00:00', '1112223333', 'george@toppagerankers.com', 'toppagerankers.com', 'contractors', '30', 'HTTPS://WWW.YELP.COM', NULL, NULL),
(3, 'Hameez', 'Tariq', 'garage door company', 'hameez@gmail.com', '(324) 983-8999', 'testing project', NULL, 1, 1, 'Lead', NULL, '2022-08-02 12:41:09', '2022-08-02 12:45:14', '2022-08-10 15:00:00', '(232) 323-232', 'garagedoor@gmail.com', 'garagedoor.com', 'garage door,doors', '30', 'HTTPS://WWW.YELP.COM', NULL, NULL);

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

--
-- Table structure for table `lead_notes`
--

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

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

--
-- Table structure for table `lead_statuses`
--

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

--
-- Dumping data for table `lead_statuses`
--

INSERT INTO `lead_statuses` (`id`, `title`, `color`) VALUES
(1, 'Pending', '#ffe32e');

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

--
-- Table structure for table `media`
--

CREATE TABLE `media` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `model_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `model_id` bigint(20) UNSIGNED NOT NULL,
  `uuid` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `collection_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `file_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `mime_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `disk` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `conversions_disk` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `size` bigint(20) UNSIGNED NOT NULL,
  `manipulations` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`manipulations`)),
  `custom_properties` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`custom_properties`)),
  `generated_conversions` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`generated_conversions`)),
  `responsive_images` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`responsive_images`)),
  `order_column` int(10) UNSIGNED 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 `messages`
--

CREATE TABLE `messages` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `conversation_id` bigint(20) UNSIGNED DEFAULT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `text` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `attachment` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `attachment_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT 'Text',
  `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 `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, '0000_00_00_000000_create_websockets_statistics_entries_table', 1),
(2, '2014_10_12_000000_create_users_table', 1),
(3, '2014_10_12_100000_create_password_resets_table', 1),
(4, '2014_10_12_200000_add_two_factor_columns_to_users_table', 1),
(5, '2019_08_19_000000_create_failed_jobs_table', 1),
(6, '2020_09_01_084206_create_permission_tables', 1),
(7, '2020_09_11_061453_create_settings_table', 1),
(8, '2020_11_02_065703_create_sessions_table', 1),
(9, '2020_12_07_074909_create_notifications_table', 1),
(10, '2021_03_04_110450_create_activity_log_table', 1),
(11, '2021_03_04_164355_create_lead_statuses_table', 1),
(12, '2021_03_04_172151_create_departments_table', 1),
(13, '2021_03_04_181118_create_leads_table', 1),
(14, '2021_03_05_174222_create_lead_notes_table', 1),
(15, '2021_03_05_181338_create_services_table', 1),
(16, '2021_03_08_124458_create_service_commend_table', 1),
(17, '2021_03_08_181828_create_customers_table', 1),
(18, '2021_03_10_123352_create_attendance_types_table', 1),
(19, '2021_03_10_132410_create_attendances_table', 1),
(20, '2021_03_11_113126_create_restricted_ips_table', 1),
(21, '2021_03_24_134810_create_conversations_table', 1),
(22, '2021_04_06_141037_create_campaign_statuses_table', 1),
(23, '2021_04_06_153736_create_campaigns_table', 1),
(24, '2021_04_12_124335_create_campaign_notes_table', 1),
(25, '2021_04_13_125852_create_tmp_media_table', 1),
(26, '2021_04_13_140345_create_media_table', 1),
(27, '2021_04_14_123300_create_campaign_services_and_commands_table', 1),
(28, '2021_04_17_143833_update_campaign_command_add_tech_id', 1),
(29, '2021_04_22_120841_create_campaign_reminders_table', 1),
(30, '2021_04_24_144458_update_leads_table_add_closer', 1),
(31, '2021_04_27_122015_update_leads_add_follow_up_time', 1),
(32, '2021_05_05_142243_update_campaigns_table_add_active', 1),
(33, '2021_05_05_165538_update_campaigns_add_card_columns', 1),
(34, '2021_05_10_141841_update_campaign_command_add_department', 1),
(35, '2021_05_18_164054_update_leads_add_extra_columns', 1),
(36, '2021_05_19_150240_update_messages_add_attachment_name', 1),
(37, '2021_05_26_114317_update_customers_change_active_column', 1),
(38, '2021_05_26_125422_update_customers_add_status_reason', 1),
(39, '2021_05_26_132257_update_campaigns_store_lead_id', 1),
(40, '2021_05_26_150658_update_campaigns_add_flag_columns', 1),
(41, '2021_05_26_180027_create_campaign_payments_table', 1),
(42, '2021_05_26_191119_update_leads_add_transfer_date', 1),
(43, '2021_05_27_130209_create_campaign_followups_table', 1),
(44, '2021_06_02_123543_update_customers_target_columns', 1),
(45, '2021_06_17_171506_update_campaigns_add_yelp_radius_keyword', 1),
(46, '2021_06_18_120113_create_notes_table', 1),
(47, '2021_06_29_120648_create_announcements_table', 1),
(48, '2021_06_29_134123_create_categories_table', 1),
(49, '2021_06_29_145712_create_sub_categories_table', 1),
(50, '2021_06_29_160034_create_articles_table', 1),
(51, '2021_06_30_120652_update_campaign_command_change_note_type', 1),
(52, '2021_06_30_154752_create_referrals_table', 1),
(53, '2021_07_08_133901_create_announcement_department_table', 1),
(54, '2021_07_15_184455_update_campaigns_change_target_keywords_to_text', 1),
(55, '2021_07_16_121001_update_referrals_add_new_columns', 1),
(56, '2021_08_02_105609_update_announcements_add_active_column', 1),
(57, '2021_08_10_105120_update_campaign_followup_add_time_column', 1),
(58, '2021_08_10_165143_update_service_commands_add_dead_line', 1),
(59, '2021_08_10_172934_update_campaign_commands_add_due_time', 1),
(60, '2021_08_10_180457_update_campaigns_add_support_agent_assigned_date', 1),
(61, '2021_08_10_184753_update_campaigns_add_payment_date', 1),
(62, '2021_08_20_123647_update_campaign_table_add_login_detail', 1),
(63, '2021_08_21_103558_update_participants_add_un_read_column', 1),
(64, '2021_08_25_114227_update_campaign_command_add_dates_for_department_and_tech_assign', 1),
(65, '2021_08_28_132540_update_campaign_follow_up_add_user_id', 1),
(66, '2021_09_03_163043_update_campaigns_add_gmp_listing_columns', 1),
(67, '2021_09_28_105242_update_campaign_followup_increase_note_length', 1),
(68, '2021_09_28_105744_update_campaign_change_flag_note_length', 1),
(69, '2021_09_28_114325_update_campaign_payment_change_note_length', 1),
(70, '2021_11_02_121724_update_campaign_add_access_email', 1),
(71, '2021_11_10_111744_update_campaigns_add_credrential_details', 1);

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

--
-- Table structure for table `model_has_permissions`
--

CREATE TABLE `model_has_permissions` (
  `permission_id` bigint(20) UNSIGNED NOT NULL,
  `model_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `model_id` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `model_has_roles`
--

CREATE TABLE `model_has_roles` (
  `role_id` bigint(20) UNSIGNED NOT NULL,
  `model_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `model_id` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `model_has_roles`
--

INSERT INTO `model_has_roles` (`role_id`, `model_type`, `model_id`) VALUES
(1, 'App\\User', 1),
(4, 'App\\User', 3),
(4, 'App\\User', 5),
(8, 'App\\User', 2),
(9, 'App\\User', 4),
(9, 'App\\User', 6);

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

--
-- Table structure for table `notes`
--

CREATE TABLE `notes` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `note` longtext 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;

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

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

CREATE TABLE `notifications` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `notifiable_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `notifiable_id` bigint(20) UNSIGNED NOT NULL,
  `data` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `read_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;

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

INSERT INTO `notifications` (`id`, `type`, `notifiable_type`, `notifiable_id`, `data`, `read_at`, `created_at`, `updated_at`) VALUES
('c7deb195-dd8b-4ea0-9098-0eadd71092af', 'App\\Notifications\\LeadCloserAssignNotification', 'App\\User', 2, '{\"url\":\"http:\\/\\/127.0.0.1:8000\\/panel\\/leads\\/1\",\"title\":\"Lead #1 is assigned to you.\"}', NULL, '2022-07-12 19:27:26', '2022-07-12 19:27:26'),
('f692bf89-bc29-4fc6-b3ab-42d1cfb983e1', 'App\\Notifications\\LeadCloserAssignNotification', 'App\\User', 2, '{\"url\":\"http:\\/\\/127.0.0.1:8000\\/panel\\/leads\\/1\",\"title\":\"Lead #1 is assigned to you.\"}', NULL, '2022-07-12 19:27:18', '2022-07-12 19:27:18');

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

--
-- Table structure for table `participants`
--

CREATE TABLE `participants` (
  `conversation_id` bigint(20) UNSIGNED DEFAULT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `unread` tinyint(1) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `permissions`
--

CREATE TABLE `permissions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `guard_name` varchar(255) 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 `permissions`
--

INSERT INTO `permissions` (`id`, `name`, `guard_name`, `created_at`, `updated_at`) VALUES
(1, 'users', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(2, 'users-add', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(3, 'users-edit', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(4, 'users-view', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(5, 'users-delete', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(6, 'users-password-change', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(7, 'users-documents', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(8, 'users-documents-add', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(9, 'users-documents-delete', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(10, 'customers', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(11, 'customers-add', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(12, 'customers-edit', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(13, 'customers-view', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(14, 'customers-delete', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(15, 'customers-manage-active', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(16, 'customers-status-detail', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(17, 'leads', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(18, 'leads-add', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(19, 'leads-edit', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(20, 'leads-view', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(21, 'leads-note', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(22, 'leads-note-add', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(23, 'leads-delete', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(24, 'leads-status-change', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(25, 'leads-closer-change', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(26, 'campaigns', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(27, 'campaigns-add', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(28, 'campaigns-edit', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(29, 'campaigns-view', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(30, 'campaigns-delete', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(31, 'campaigns-customer-info', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(32, 'campaigns-description', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(33, 'campaigns-manage-active', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(34, 'campaigns-flag', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(35, 'campaigns-payment-date', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(36, 'campaigns-status-update', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(37, 'campaigns-assign-sales-agent', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(38, 'campaigns-support-sales-agent', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(39, 'campaigns-note', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(40, 'campaigns-note-add', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(41, 'campaigns-attachments', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(42, 'campaigns-attachments-add', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(43, 'campaigns-attachments-delete', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(44, 'campaigns-services', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(45, 'campaigns-services-add', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(46, 'campaigns-services-edit', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(47, 'campaigns-services-delete', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(48, 'campaigns-commands-add', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(49, 'campaigns-commands-edit', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(50, 'campaigns-commands-delete', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(51, 'campaigns-commands-assign-department', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(52, 'campaigns-commands-assign-tech', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(53, 'campaigns-commands-mark-complete', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(54, 'campaigns-reminders', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(55, 'campaigns-reminders-add', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(56, 'campaigns-reminders-edit', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(57, 'campaigns-reminders-delete', 'web', '2022-07-07 22:34:02', '2022-07-07 22:34:02'),
(58, 'campaigns-payments', 'web', '2022-07-07 22:34:02', '2022-07-07 22:34:02'),
(59, 'campaigns-payments-add', 'web', '2022-07-07 22:34:02', '2022-07-07 22:34:02'),
(60, 'campaigns-payments-edit', 'web', '2022-07-07 22:34:02', '2022-07-07 22:34:02'),
(61, 'campaigns-payments-delete', 'web', '2022-07-07 22:34:02', '2022-07-07 22:34:02'),
(62, 'campaigns-followups', 'web', '2022-07-07 22:34:02', '2022-07-07 22:34:02'),
(63, 'campaigns-followups-add', 'web', '2022-07-07 22:34:02', '2022-07-07 22:34:02'),
(64, 'campaigns-followups-delete', 'web', '2022-07-07 22:34:02', '2022-07-07 22:34:02'),
(65, 'announcements', 'web', '2022-07-07 22:34:02', '2022-07-07 22:34:02'),
(66, 'announcements-add', 'web', '2022-07-07 22:34:02', '2022-07-07 22:34:02'),
(67, 'announcements-edit', 'web', '2022-07-07 22:34:02', '2022-07-07 22:34:02'),
(68, 'announcements-delete', 'web', '2022-07-07 22:34:02', '2022-07-07 22:34:02'),
(69, 'announcements-status', 'web', '2022-07-07 22:34:02', '2022-07-07 22:34:02'),
(70, 'attendance', 'web', '2022-07-07 22:34:02', '2022-07-07 22:34:02'),
(71, 'attendance-delete', 'web', '2022-07-07 22:34:02', '2022-07-07 22:34:02'),
(72, 'reports-attendance', 'web', '2022-07-07 22:34:02', '2022-07-07 22:34:02'),
(73, 'reports-users-attendance', 'web', '2022-07-07 22:34:02', '2022-07-07 22:34:02'),
(74, 'reports-transfers', 'web', '2022-07-07 22:34:02', '2022-07-07 22:34:02'),
(75, 'reports-sales', 'web', '2022-07-07 22:34:02', '2022-07-07 22:34:02'),
(76, 'reports-active-clients', 'web', '2022-07-07 22:34:02', '2022-07-07 22:34:02'),
(77, 'reports-deactive-clients', 'web', '2022-07-07 22:34:02', '2022-07-07 22:34:02'),
(78, 'reports-tech', 'web', '2022-07-07 22:34:02', '2022-07-07 22:34:02'),
(79, 'permissions', 'web', '2022-07-07 22:34:02', '2022-07-07 22:34:02');

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

--
-- Table structure for table `referrals`
--

CREATE TABLE `referrals` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `note` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `company_name` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `owner_name` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `website` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `service_area` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `business_category` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `keywords` text COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `restricted_ips`
--

CREATE TABLE `restricted_ips` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `ip` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `note` text COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `roles`
--

CREATE TABLE `roles` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `guard_name` varchar(255) 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 `roles`
--

INSERT INTO `roles` (`id`, `name`, `guard_name`, `created_at`, `updated_at`) VALUES
(1, 'Super Admin', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(2, 'Admin', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(3, 'Sales Agent', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(4, 'Support Agent', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(5, 'Tech', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(6, 'Coordinator', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(7, 'Team Lead', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(8, 'Closer', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(9, 'Quality Department Executive', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01'),
(10, 'HR', 'web', '2022-07-07 22:34:01', '2022-07-07 22:34:01');

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

--
-- Table structure for table `role_has_permissions`
--

CREATE TABLE `role_has_permissions` (
  `permission_id` bigint(20) UNSIGNED NOT NULL,
  `role_id` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `role_has_permissions`
--

INSERT INTO `role_has_permissions` (`permission_id`, `role_id`) VALUES
(10, 9),
(12, 9),
(13, 9),
(15, 9),
(16, 9),
(17, 9),
(20, 9),
(26, 9),
(29, 9),
(33, 9);

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

--
-- Table structure for table `services`
--

CREATE TABLE `services` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `department_id` bigint(20) UNSIGNED DEFAULT NULL,
  `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `price` int(11) DEFAULT NULL,
  `description` 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;

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

--
-- Table structure for table `service_commands`
--

CREATE TABLE `service_commands` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `service_id` bigint(20) UNSIGNED DEFAULT NULL,
  `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deadline` int(11) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `sessions`
--

CREATE TABLE `sessions` (
  `id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payload` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `last_activity` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `sub_categories`
--

CREATE TABLE `sub_categories` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `category_id` bigint(20) UNSIGNED DEFAULT NULL,
  `title` 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;

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

--
-- Table structure for table `temp_media`
--

CREATE TABLE `temp_media` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `path` varchar(255) 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 `websockets_statistics_entries`
--

CREATE TABLE `websockets_statistics_entries` (
  `id` int(10) UNSIGNED NOT NULL,
  `app_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `peak_connection_count` int(11) NOT NULL,
  `websocket_message_count` int(11) NOT NULL,
  `api_message_count` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `activity_log`
--
ALTER TABLE `activity_log`
  ADD PRIMARY KEY (`id`),
  ADD KEY `subject` (`subject_type`,`subject_id`),
  ADD KEY `causer` (`causer_type`,`causer_id`),
  ADD KEY `activity_log_log_name_index` (`log_name`);

--
-- Indexes for table `announcements`
--
ALTER TABLE `announcements`
  ADD PRIMARY KEY (`id`),
  ADD KEY `announcements_created_by_foreign` (`created_by`);

--
-- Indexes for table `announcement_department`
--
ALTER TABLE `announcement_department`
  ADD KEY `announcement_department_announcement_id_foreign` (`announcement_id`),
  ADD KEY `announcement_department_department_id_foreign` (`department_id`);

--
-- Indexes for table `articles`
--
ALTER TABLE `articles`
  ADD PRIMARY KEY (`id`),
  ADD KEY `articles_category_id_foreign` (`category_id`);

--
-- Indexes for table `article_sub_category`
--
ALTER TABLE `article_sub_category`
  ADD KEY `article_sub_category_article_id_foreign` (`article_id`),
  ADD KEY `article_sub_category_sub_category_id_foreign` (`sub_category_id`);

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

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

--
-- Indexes for table `campaign_command`
--
ALTER TABLE `campaign_command`
  ADD PRIMARY KEY (`id`),
  ADD KEY `campaign_command_campaign_id_foreign` (`campaign_id`),
  ADD KEY `campaign_command_service_id_foreign` (`service_id`),
  ADD KEY `campaign_command_command_id_foreign` (`command_id`),
  ADD KEY `campaign_command_tech_id_foreign` (`tech_id`),
  ADD KEY `campaign_command_department_id_foreign` (`department_id`);

--
-- Indexes for table `campaign_followups`
--
ALTER TABLE `campaign_followups`
  ADD PRIMARY KEY (`id`),
  ADD KEY `campaign_followups_campaign_id_foreign` (`campaign_id`),
  ADD KEY `campaign_followups_user_id_foreign` (`user_id`);

--
-- Indexes for table `campaign_notes`
--
ALTER TABLE `campaign_notes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `campaign_notes_campaign_id_foreign` (`campaign_id`),
  ADD KEY `campaign_notes_user_id_foreign` (`user_id`);

--
-- Indexes for table `campaign_payments`
--
ALTER TABLE `campaign_payments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `campaign_payments_campaign_id_foreign` (`campaign_id`);

--
-- Indexes for table `campaign_reminders`
--
ALTER TABLE `campaign_reminders`
  ADD PRIMARY KEY (`id`),
  ADD KEY `campaign_reminders_campaign_id_foreign` (`campaign_id`);

--
-- Indexes for table `campaign_service`
--
ALTER TABLE `campaign_service`
  ADD KEY `campaign_service_campaign_id_foreign` (`campaign_id`),
  ADD KEY `campaign_service_service_id_foreign` (`service_id`);

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

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

--
-- Indexes for table `conversations`
--
ALTER TABLE `conversations`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `conversations_uid_unique` (`uid`);

--
-- Indexes for table `customers`
--
ALTER TABLE `customers`
  ADD PRIMARY KEY (`id`),
  ADD KEY `customers_created_by_foreign` (`created_by`);

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

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

--
-- Indexes for table `leads`
--
ALTER TABLE `leads`
  ADD PRIMARY KEY (`id`),
  ADD KEY `leads_department_id_foreign` (`department_id`),
  ADD KEY `leads_lead_status_id_foreign` (`lead_status_id`),
  ADD KEY `leads_created_by_foreign` (`created_by`),
  ADD KEY `leads_closer_id_foreign` (`closer_id`);

--
-- Indexes for table `lead_notes`
--
ALTER TABLE `lead_notes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `lead_notes_lead_id_foreign` (`lead_id`),
  ADD KEY `lead_notes_user_id_foreign` (`user_id`);

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

--
-- Indexes for table `media`
--
ALTER TABLE `media`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `media_uuid_unique` (`uuid`),
  ADD KEY `media_model_type_model_id_index` (`model_type`,`model_id`);

--
-- Indexes for table `messages`
--
ALTER TABLE `messages`
  ADD PRIMARY KEY (`id`),
  ADD KEY `messages_conversation_id_foreign` (`conversation_id`),
  ADD KEY `messages_user_id_foreign` (`user_id`);

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

--
-- Indexes for table `model_has_permissions`
--
ALTER TABLE `model_has_permissions`
  ADD PRIMARY KEY (`permission_id`,`model_id`,`model_type`),
  ADD KEY `model_has_permissions_model_id_model_type_index` (`model_id`,`model_type`);

--
-- Indexes for table `model_has_roles`
--
ALTER TABLE `model_has_roles`
  ADD PRIMARY KEY (`role_id`,`model_id`,`model_type`),
  ADD KEY `model_has_roles_model_id_model_type_index` (`model_id`,`model_type`);

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

--
-- Indexes for table `notifications`
--
ALTER TABLE `notifications`
  ADD PRIMARY KEY (`id`),
  ADD KEY `notifications_notifiable_type_notifiable_id_index` (`notifiable_type`,`notifiable_id`);

--
-- Indexes for table `participants`
--
ALTER TABLE `participants`
  ADD KEY `participants_conversation_id_foreign` (`conversation_id`),
  ADD KEY `participants_user_id_foreign` (`user_id`);

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

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

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

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

--
-- Indexes for table `role_has_permissions`
--
ALTER TABLE `role_has_permissions`
  ADD PRIMARY KEY (`permission_id`,`role_id`),
  ADD KEY `role_has_permissions_role_id_foreign` (`role_id`);

--
-- Indexes for table `services`
--
ALTER TABLE `services`
  ADD PRIMARY KEY (`id`),
  ADD KEY `services_department_id_foreign` (`department_id`);

--
-- Indexes for table `service_commands`
--
ALTER TABLE `service_commands`
  ADD PRIMARY KEY (`id`),
  ADD KEY `service_commands_service_id_foreign` (`service_id`);

--
-- Indexes for table `sessions`
--
ALTER TABLE `sessions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `sessions_user_id_index` (`user_id`),
  ADD KEY `sessions_last_activity_index` (`last_activity`);

--
-- Indexes for table `sub_categories`
--
ALTER TABLE `sub_categories`
  ADD PRIMARY KEY (`id`),
  ADD KEY `sub_categories_category_id_foreign` (`category_id`);

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

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

--
-- AUTO_INCREMENT for dumped tables
--

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

--
-- AUTO_INCREMENT for table `websockets_statistics_entries`
--
ALTER TABLE `websockets_statistics_entries`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `announcements`
--
ALTER TABLE `announcements`
  ADD CONSTRAINT `announcements_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`);

--
-- Constraints for table `announcement_department`
--
ALTER TABLE `announcement_department`
  ADD CONSTRAINT `announcement_department_announcement_id_foreign` FOREIGN KEY (`announcement_id`) REFERENCES `announcements` (`id`),
  ADD CONSTRAINT `announcement_department_department_id_foreign` FOREIGN KEY (`department_id`) REFERENCES `departments` (`id`);

--
-- Constraints for table `articles`
--
ALTER TABLE `articles`
  ADD CONSTRAINT `articles_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`);

--
-- Constraints for table `article_sub_category`
--
ALTER TABLE `article_sub_category`
  ADD CONSTRAINT `article_sub_category_article_id_foreign` FOREIGN KEY (`article_id`) REFERENCES `articles` (`id`),
  ADD CONSTRAINT `article_sub_category_sub_category_id_foreign` FOREIGN KEY (`sub_category_id`) REFERENCES `sub_categories` (`id`);

--
-- Constraints for table `attendances`
--
ALTER TABLE `attendances`
  ADD CONSTRAINT `attendances_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `campaign_command`
--
ALTER TABLE `campaign_command`
  ADD CONSTRAINT `campaign_command_campaign_id_foreign` FOREIGN KEY (`campaign_id`) REFERENCES `campaigns` (`id`),
  ADD CONSTRAINT `campaign_command_command_id_foreign` FOREIGN KEY (`command_id`) REFERENCES `service_commands` (`id`),
  ADD CONSTRAINT `campaign_command_department_id_foreign` FOREIGN KEY (`department_id`) REFERENCES `departments` (`id`),
  ADD CONSTRAINT `campaign_command_service_id_foreign` FOREIGN KEY (`service_id`) REFERENCES `services` (`id`),
  ADD CONSTRAINT `campaign_command_tech_id_foreign` FOREIGN KEY (`tech_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `campaign_followups`
--
ALTER TABLE `campaign_followups`
  ADD CONSTRAINT `campaign_followups_campaign_id_foreign` FOREIGN KEY (`campaign_id`) REFERENCES `campaigns` (`id`),
  ADD CONSTRAINT `campaign_followups_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `campaign_notes`
--
ALTER TABLE `campaign_notes`
  ADD CONSTRAINT `campaign_notes_campaign_id_foreign` FOREIGN KEY (`campaign_id`) REFERENCES `campaigns` (`id`),
  ADD CONSTRAINT `campaign_notes_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `campaign_payments`
--
ALTER TABLE `campaign_payments`
  ADD CONSTRAINT `campaign_payments_campaign_id_foreign` FOREIGN KEY (`campaign_id`) REFERENCES `campaigns` (`id`);

--
-- Constraints for table `campaign_reminders`
--
ALTER TABLE `campaign_reminders`
  ADD CONSTRAINT `campaign_reminders_campaign_id_foreign` FOREIGN KEY (`campaign_id`) REFERENCES `campaigns` (`id`);

--
-- Constraints for table `campaign_service`
--
ALTER TABLE `campaign_service`
  ADD CONSTRAINT `campaign_service_campaign_id_foreign` FOREIGN KEY (`campaign_id`) REFERENCES `campaigns` (`id`),
  ADD CONSTRAINT `campaign_service_service_id_foreign` FOREIGN KEY (`service_id`) REFERENCES `services` (`id`);

--
-- Constraints for table `customers`
--
ALTER TABLE `customers`
  ADD CONSTRAINT `customers_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`);

--
-- Constraints for table `leads`
--
ALTER TABLE `leads`
  ADD CONSTRAINT `leads_closer_id_foreign` FOREIGN KEY (`closer_id`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `leads_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `leads_department_id_foreign` FOREIGN KEY (`department_id`) REFERENCES `departments` (`id`),
  ADD CONSTRAINT `leads_lead_status_id_foreign` FOREIGN KEY (`lead_status_id`) REFERENCES `lead_statuses` (`id`);

--
-- Constraints for table `lead_notes`
--
ALTER TABLE `lead_notes`
  ADD CONSTRAINT `lead_notes_lead_id_foreign` FOREIGN KEY (`lead_id`) REFERENCES `leads` (`id`),
  ADD CONSTRAINT `lead_notes_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `messages`
--
ALTER TABLE `messages`
  ADD CONSTRAINT `messages_conversation_id_foreign` FOREIGN KEY (`conversation_id`) REFERENCES `conversations` (`id`),
  ADD CONSTRAINT `messages_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `model_has_permissions`
--
ALTER TABLE `model_has_permissions`
  ADD CONSTRAINT `model_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `model_has_roles`
--
ALTER TABLE `model_has_roles`
  ADD CONSTRAINT `model_has_roles_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `notes`
--
ALTER TABLE `notes`
  ADD CONSTRAINT `notes_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `participants`
--
ALTER TABLE `participants`
  ADD CONSTRAINT `participants_conversation_id_foreign` FOREIGN KEY (`conversation_id`) REFERENCES `conversations` (`id`),
  ADD CONSTRAINT `participants_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `referrals`
--
ALTER TABLE `referrals`
  ADD CONSTRAINT `referrals_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `role_has_permissions`
--
ALTER TABLE `role_has_permissions`
  ADD CONSTRAINT `role_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `role_has_permissions_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `services`
--
ALTER TABLE `services`
  ADD CONSTRAINT `services_department_id_foreign` FOREIGN KEY (`department_id`) REFERENCES `departments` (`id`);

--
-- Constraints for table `service_commands`
--
ALTER TABLE `service_commands`
  ADD CONSTRAINT `service_commands_service_id_foreign` FOREIGN KEY (`service_id`) REFERENCES `services` (`id`);

--
-- Constraints for table `sub_categories`
--
ALTER TABLE `sub_categories`
  ADD CONSTRAINT `sub_categories_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`);
COMMIT;

