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

START TRANSACTION;



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

--
-- Table structure for table `bookings`
--

CREATE TABLE `bookings` (
  `id` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `building_id` bigint(20) NOT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `date` date NOT NULL,
  `time_from` time NOT NULL,
  `time_to` time NOT NULL,
  `status` enum('available','booked') COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `bookings`
--

INSERT INTO `bookings` (`id`, `created_at`, `updated_at`, `deleted_at`, `building_id`, `user_id`, `date`, `time_from`, `time_to`, `status`) VALUES
(1, '2019-04-08 16:18:28', '2019-04-08 16:18:43', NULL, 5, NULL, '2019-04-08', '08:30:00', '08:30:00', 'available');

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

--
-- Table structure for table `buildings`
--

CREATE TABLE `buildings` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` longtext COLLATE utf8mb4_unicode_ci,
  `category_id` bigint(20) UNSIGNED DEFAULT NULL,
  `city_id` bigint(20) UNSIGNED DEFAULT NULL,
  `floor` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `rooms` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `bathrooms` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `price` decimal(8,2) NOT NULL,
  `lat` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `lng` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `section_id` bigint(20) UNSIGNED NOT NULL,
  `affiliate` decimal(8,1) NOT NULL,
  `view_type` enum('public','company') COLLATE utf8mb4_unicode_ci NOT NULL,
  `announcer_type` enum('owner','dealer') COLLATE utf8mb4_unicode_ci NOT NULL,
  `mortgage` tinyint(1) NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `status` enum('waiting','refused','accepted','done') COLLATE utf8mb4_unicode_ci NOT NULL,
  `reviewed_by` bigint(20) UNSIGNED NOT NULL,
  `views` int(11) NOT NULL DEFAULT '0',
  `image` longtext COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `buildings`
--

INSERT INTO `buildings` (`id`, `created_at`, `updated_at`, `deleted_at`, `name`, `description`, `category_id`, `city_id`, `floor`, `rooms`, `bathrooms`, `price`, `lat`, `lng`, `section_id`, `affiliate`, `view_type`, `announcer_type`, `mortgage`, `user_id`, `status`, `reviewed_by`, `views`, `image`) VALUES
(5, '2019-04-08 11:50:43', '2019-04-13 09:31:39', NULL, 'Callie Hale', 'Ducimus est ipsa v', 1, 1, '12', '68', '100', '381.00', '31.0384610507188', '31.365053267528538', 1, '53.0', 'public', 'owner', 0, 1, 'accepted', 1, 0, 'uploads/projects/20190408135043-46142147_1915149448593075_4331853651959087104_n.jpg'),
(6, '2019-04-08 11:50:45', '2019-04-08 11:50:45', NULL, 'Callie Hale', 'Ducimus est ipsa v', 1, 1, '12', '68', '100', '381.00', '31.0384610507188', '31.365053267528538', 1, '53.0', 'public', 'dealer', 0, 1, 'waiting', 0, 0, 'uploads/projects/20190408135045-46142147_1915149448593075_4331853651959087104_n.jpg');

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

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

CREATE TABLE `categories` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `name_ar` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name_en` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `categories` (`id`, `created_at`, `updated_at`, `deleted_at`, `name_ar`, `name_en`) VALUES
(1, '2019-04-07 09:33:00', '2019-04-07 09:33:00', NULL, 'Kareem Pope', 'Rudyard Sampson');

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

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

CREATE TABLE `cities` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `name_en` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name_ar` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `cities` (`id`, `created_at`, `updated_at`, `deleted_at`, `name_en`, `name_ar`) VALUES
(1, '2019-04-07 09:12:48', '2019-04-07 09:12:48', NULL, 'Robert Morris', 'Kalia Valenzuela'),
(2, '2019-04-07 09:12:53', '2019-04-07 09:22:39', '2019-04-07 09:22:39', 'Ginger Mcdaniel', 'Brady Haley'),
(3, '2019-04-07 09:13:53', '2019-04-07 09:22:29', '2019-04-07 09:22:29', 'Wayne Fitzgerald', 'Lael May');

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

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

CREATE TABLE `departments` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name_ar` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name_en` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `deleted_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 `departments`
--

INSERT INTO `departments` (`id`, `name_ar`, `name_en`, `deleted_at`, `created_at`, `updated_at`) VALUES
(1, 'Quon Everett', 'Donna Waters', NULL, '2019-04-07 10:13:06', '2019-04-07 10:13:06'),
(2, 'Kiara Oliver', 'Chiquita Roberson', NULL, '2019-04-07 12:47:45', '2019-04-07 12:47:45'),
(3, 'Kiara Oliver', 'Chiquita Roberson', NULL, '2019-04-07 12:48:37', '2019-04-07 12:48:37'),
(4, 'Tatyana Jarvis', 'Gavin Guzman', NULL, '2019-04-07 12:50:18', '2019-04-07 12:50:18');

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

--
-- Table structure for table `departments_users`
--

CREATE TABLE `departments_users` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `user_id` bigint(20) NOT NULL,
  `department_id` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `departments_users`
--

INSERT INTO `departments_users` (`id`, `created_at`, `updated_at`, `deleted_at`, `user_id`, `department_id`) VALUES
(3, '2019-04-07 12:50:18', '2019-04-07 12:50:18', NULL, 1, 4),
(4, '2019-04-07 12:50:18', '2019-04-07 12:50:18', NULL, 3, 4);

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

--
-- Table structure for table `department_files`
--

CREATE TABLE `department_files` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `file_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `file_date` timestamp NULL DEFAULT NULL,
  `description` longtext COLLATE utf8mb4_unicode_ci,
  `department_id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `departments_user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `file` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `file_ext` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `revision` longtext COLLATE utf8mb4_unicode_ci
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `department_files`
--

INSERT INTO `department_files` (`id`, `created_at`, `updated_at`, `deleted_at`, `name`, `file_number`, `file_date`, `description`, `department_id`, `user_id`, `departments_user_id`, `file`, `file_ext`, `revision`) VALUES
(2, '2019-04-07 14:21:46', '2019-04-07 14:24:56', NULL, 'Zorita Ramsey', '77', '2019-04-07 14:24:56', 'Magni facilis dolore', 4, 3, 3, 'uploads/files/20190407162146-46096201_153150785644663_8145357068287606784_n.jpg', 'jpg', NULL),
(3, '2019-04-10 10:50:08', '2019-04-10 10:50:08', NULL, 'اسم الملف', '912627', NULL, 'اى حاجه', 4, 0, 3, 'E:\\xampp\\tmp\\phpF443.tmp', NULL, NULL),
(4, '2019-04-10 10:51:37', '2019-04-10 11:14:27', '2019-04-10 11:14:27', 'اسم الملف معدل', '912627', NULL, 'اى حاجه', 4, 1, 3, 'uploads/files/department-4/20190410130230-49658181_2213645398955939_3894525672265089024_n.jpg', 'jpg', NULL),
(5, '2019-04-10 11:09:11', '2019-04-11 11:17:22', NULL, 'اسم الملف معدل', '912627', NULL, 'اى حاجه', 4, 1, 3, 'uploads/files/department-4/20190410130911-49658181_2213645398955939_3894525672265089024_n.jpg', 'jpg', 'revision');

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

--
-- Table structure for table `favourites`
--

CREATE TABLE `favourites` (
  `id` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `model_type` varchar(191) 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 `favourites`
--

INSERT INTO `favourites` (`id`, `created_at`, `updated_at`, `deleted_at`, `user_id`, `model_type`, `model_id`) VALUES
(1, NULL, NULL, NULL, 1, 'App\\Models\\Building', 6),
(4, NULL, NULL, NULL, 1, 'App\\Models\\Building', 5);

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

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

CREATE TABLE `images` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `image` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `extension` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `model_id` bigint(20) UNSIGNED NOT NULL,
  `model_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `images` (`id`, `created_at`, `updated_at`, `deleted_at`, `image`, `extension`, `model_id`, `model_type`) VALUES
(5, '2019-04-08 11:50:43', '2019-04-08 11:50:43', NULL, 'uploads/projects/5/20190408135043-45931255_153150275644714_2582642974152196096_n.jpg', 'jpg', 5, 'App\\Models\\Building'),
(6, '2019-04-08 11:50:44', '2019-04-08 11:50:44', NULL, 'uploads/projects/5/20190408135043-46096201_153150785644663_8145357068287606784_n.jpg', 'jpg', 5, 'App\\Models\\Building'),
(7, '2019-04-08 11:50:44', '2019-04-08 11:50:44', NULL, 'uploads/projects/5/20190408135043-46142147_1915149448593075_4331853651959087104_n.jpg', 'jpg', 5, 'App\\Models\\Building'),
(8, '2019-04-08 11:50:45', '2019-04-08 11:50:45', NULL, 'uploads/projects/6/20190408135045-45931255_153150275644714_2582642974152196096_n.jpg', 'jpg', 6, 'App\\Models\\Building'),
(9, '2019-04-08 11:50:45', '2019-04-08 11:50:45', NULL, 'uploads/projects/6/20190408135045-46096201_153150785644663_8145357068287606784_n.jpg', 'jpg', 6, 'App\\Models\\Building'),
(10, '2019-04-08 11:50:45', '2019-04-08 11:50:45', NULL, 'uploads/projects/6/20190408135045-46142147_1915149448593075_4331853651959087104_n.jpg', 'jpg', 6, 'App\\Models\\Building');

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

--
-- Table structure for table `migrations`
--

CREATE TABLE `migrations` (
  `id` int(10) UNSIGNED NOT NULL,
  `migration` varchar(191) 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_04_02_193005_create_translations_table', 1),
(2, '2014_10_12_000000_create_users_table', 1),
(3, '2014_10_12_100000_create_password_resets_table', 1),
(4, '2019_03_02_140907_create_permission_tables', 1),
(5, '2019_03_02_143048_create_admin_password_resets_table', 1),
(6, '2019_03_02_143048_create_admins_table', 1),
(7, '2019_03_09_155549_create_settings_table', 1),
(8, '2019_04_04_123131_create_bookings_table', 1),
(9, '2019_04_04_123131_create_buildings_table', 1),
(10, '2019_04_04_123131_create_categories_table', 1),
(11, '2019_04_04_123131_create_cities_table', 1),
(12, '2019_04_04_123131_create_department_files_table', 1),
(13, '2019_04_04_123131_create_departments_table', 1),
(14, '2019_04_04_123131_create_departments_users_table', 1),
(15, '2019_04_04_123131_create_favourites_table', 1),
(16, '2019_04_04_123131_create_images_table', 1),
(17, '2019_04_04_123131_create_projects_table', 1),
(18, '2019_04_04_123131_create_sections_table', 1),
(19, '2019_04_04_123131_create_task_costs_table', 1),
(20, '2019_04_04_123131_create_tasks_table', 1),
(21, '2019_04_04_123131_create_tasks_users_table', 1),
(22, '2019_04_04_123131_create_user_searches_table', 1),
(23, '2019_04_04_123141_create_foreign_keys', 1);

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

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

CREATE TABLE `model_has_permissions` (
  `permission_id` int(10) UNSIGNED NOT NULL,
  `model_type` varchar(191) 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` int(10) UNSIGNED NOT NULL,
  `model_type` varchar(191) 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 `permissions`
--

CREATE TABLE `permissions` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `slug` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `guard_name` varchar(191) 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 `projects`
--

CREATE TABLE `projects` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name_ar` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name_en` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `deleted_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 `projects`
--

INSERT INTO `projects` (`id`, `name_ar`, `name_en`, `deleted_at`, `created_at`, `updated_at`) VALUES
(1, 'Yeo Ferguson', 'Rhoda Hernandez', NULL, '2019-04-07 10:15:12', '2019-04-07 10:15:12');

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

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

CREATE TABLE `roles` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `slug` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `guard_name` varchar(191) 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 `role_has_permissions`
--

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

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

--
-- Table structure for table `sections`
--

CREATE TABLE `sections` (
  `id` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `name_ar` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name_en` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sections`
--

INSERT INTO `sections` (`id`, `created_at`, `updated_at`, `deleted_at`, `name_ar`, `name_en`) VALUES
(1, '2019-04-07 10:13:40', '2019-04-07 10:13:40', NULL, 'Jackson Hubbard', 'Ray Bean');

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

--
-- Table structure for table `settings`
--

CREATE TABLE `settings` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `slug` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `value_ar` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `value_en` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` enum('text','number','email','textarea','map','select','file') 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 `tasks`
--

CREATE TABLE `tasks` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `project_id` bigint(20) UNSIGNED NOT NULL,
  `date` timestamp NULL DEFAULT NULL,
  `rate` tinyint(4) DEFAULT '0',
  `creator_id` bigint(20) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tasks`
--

INSERT INTO `tasks` (`id`, `created_at`, `updated_at`, `deleted_at`, `name`, `description`, `project_id`, `date`, `rate`, `creator_id`) VALUES
(4, '2019-04-07 12:21:12', '2019-04-07 12:21:12', NULL, 'Vance Roach', 'Aperiam deserunt aut', 1, '2019-05-05 22:00:00', 0, 3),
(11, '2019-04-11 06:17:51', '2019-04-11 06:17:51', NULL, 'ddd', '3', 1, '2019-09-30 22:00:00', 0, 1),
(12, '2019-04-11 06:35:33', '2019-04-11 06:47:57', NULL, 'معدل', 'تعدل بيانات تاسك', 1, '2019-09-30 22:00:00', 1, 1);

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

--
-- Table structure for table `tasks_users`
--

CREATE TABLE `tasks_users` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `task_id` bigint(20) NOT NULL,
  `status` enum('waiting','done') COLLATE utf8mb4_unicode_ci DEFAULT 'waiting'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tasks_users`
--

INSERT INTO `tasks_users` (`id`, `created_at`, `updated_at`, `deleted_at`, `user_id`, `task_id`, `status`) VALUES
(6, '2019-04-07 12:21:12', '2019-04-07 12:21:12', NULL, 3, 4, 'done'),
(7, '2019-04-07 12:22:02', '2019-04-07 12:22:02', NULL, 2, 4, 'waiting'),
(8, '2019-04-10 13:00:19', '2019-04-11 10:20:02', NULL, 1, 5, 'waiting'),
(9, '2019-04-10 13:01:14', '2019-04-10 13:01:14', NULL, 1, 6, 'waiting'),
(10, '2019-04-10 13:01:53', '2019-04-10 13:01:53', NULL, 1, 7, 'waiting'),
(11, '2019-04-11 06:10:45', '2019-04-11 06:10:45', NULL, 1, 8, 'waiting'),
(12, '2019-04-11 06:13:52', '2019-04-11 06:13:52', NULL, 1, 9, 'waiting'),
(13, '2019-04-11 06:16:19', '2019-04-11 06:16:19', NULL, 1, 10, 'waiting'),
(14, '2019-04-11 06:17:51', '2019-04-11 06:17:51', NULL, 1, 11, 'waiting'),
(15, '2019-04-11 06:35:33', '2019-04-11 06:35:33', NULL, 1, 12, 'waiting'),
(16, '2019-04-11 06:42:23', '2019-04-11 06:42:23', NULL, 2, 12, 'waiting');

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

--
-- Table structure for table `user_searches`
--

CREATE TABLE `user_searches` (
  `id` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `search` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `price` enum('desc','asc') COLLATE utf8mb4_unicode_ci NOT NULL,
  `category_id` bigint(20) UNSIGNED NOT NULL,
  `city_id` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Indexes for table `buildings`
--
ALTER TABLE `buildings`
  ADD PRIMARY KEY (`id`),
  ADD KEY `buildings_category_id_foreign` (`category_id`),
  ADD KEY `buildings_city_id_foreign` (`city_id`);

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

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

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

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

--
-- Indexes for table `department_files`
--
ALTER TABLE `department_files`
  ADD PRIMARY KEY (`id`),
  ADD KEY `department_files_department_id_foreign` (`department_id`),
  ADD KEY `department_files_departments_user_id_foreign` (`departments_user_id`);

--
-- Indexes for table `favourites`
--
ALTER TABLE `favourites`
  ADD PRIMARY KEY (`id`),
  ADD KEY `favourites_model_type_model_id_index` (`model_type`,`model_id`);

--
-- Indexes for table `images`
--
ALTER TABLE `images`
  ADD PRIMARY KEY (`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 `permissions`
--
ALTER TABLE `permissions`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `projects`
--
ALTER TABLE `projects`
  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 `sections`
--
ALTER TABLE `sections`
  ADD PRIMARY KEY (`id`);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

--
-- Constraints for dumped tables
--

--
-- Constraints for table `buildings`
--
ALTER TABLE `buildings`
  ADD CONSTRAINT `buildings_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE SET NULL ON UPDATE SET NULL,
  ADD CONSTRAINT `buildings_city_id_foreign` FOREIGN KEY (`city_id`) REFERENCES `cities` (`id`) ON DELETE SET NULL ON UPDATE SET NULL;

--
-- Constraints for table `departments_users`
--
ALTER TABLE `departments_users`
  ADD CONSTRAINT `departments_users_department_id_foreign` FOREIGN KEY (`department_id`) REFERENCES `departments` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `department_files`
--
ALTER TABLE `department_files`
  ADD CONSTRAINT `department_files_department_id_foreign` FOREIGN KEY (`department_id`) REFERENCES `departments` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `department_files_departments_user_id_foreign` FOREIGN KEY (`departments_user_id`) REFERENCES `departments_users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

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

