text: -- phpMyAdmin SQL Dump
  -- version 4.6.6deb4
  -- https://www.phpmyadmin.net/
  --
  -- Host: localhost:3306
  -- Generation Time: Jun 09, 2018 at 03:23 PM
  -- Server version: 5.7.20-0ubuntu0.17.04.1
  -- PHP Version: 7.0.22-0ubuntu0.17.04.1
  
  SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  SET time_zone = "+00:00";
  
  
  /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  /*!40101 SET NAMES utf8mb4 */;
  
  --
  -- Database: `roomfinder`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `feedback`
  --
  
  CREATE TABLE `feedback` (
    `id` int(10) UNSIGNED NOT NULL,
    `user_id` int(10) UNSIGNED DEFAULT NULL,
    `feedback` text COLLATE utf8mb4_unicode_ci NOT NULL,
    `read` enum('0','1') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
    `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;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `images`
  --
  
  CREATE TABLE `images` (
    `id` int(10) UNSIGNED NOT NULL,
    `room_id` int(10) UNSIGNED DEFAULT NULL,
    `jagga_id` int(10) UNSIGNED DEFAULT NULL,
    `image` varchar(200) 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 `jaggas`
  --
  
  CREATE TABLE `jaggas` (
    `id` int(10) UNSIGNED NOT NULL,
    `user_id` int(10) UNSIGNED NOT NULL,
    `type` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
    `phone_no` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `loc_lat` double NOT NULL,
    `loc_lon` double NOT NULL,
    `address` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `price` double NOT NULL,
    `description` text COLLATE utf8mb4_unicode_ci NOT NULL,
    `sold` tinyint(1) 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;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `logs`
  --
  
  CREATE TABLE `logs` (
    `id` int(10) UNSIGNED NOT NULL,
    `user_id` int(10) UNSIGNED NOT NULL,
    `loc_lat` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `loc_lon` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `device_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
    `device_id` varchar(250) 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 `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
  (34, '2014_10_12_000000_create_users_table', 1),
  (35, '2014_10_12_100000_create_password_resets_table', 1),
  (36, '2018_05_27_090144_create_user_sessions_table', 1),
  (37, '2018_05_27_090212_create_logs_table', 1),
  (38, '2018_05_27_093407_create_rooms_table', 1),
  (39, '2018_05_27_093427_create_jaggas_table', 1),
  (40, '2018_05_27_094801_create_feedback_table', 1),
  (41, '2018_05_27_095639_create_spam_table', 1),
  (42, '2018_05_27_175608_create_user_favourites_table', 1),
  (43, '2018_05_27_183204_create_images__table', 1),
  (44, '2018_06_08_182727_create_notifications_table', 1);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `notifications`
  --
  
  CREATE TABLE `notifications` (
    `id` int(10) UNSIGNED NOT NULL,
    `user_id` int(10) UNSIGNED NOT NULL,
    `mobile_target_id` int(11) DEFAULT NULL,
    `type` int(11) DEFAULT NULL,
    `message` text COLLATE utf8mb4_unicode_ci NOT NULL,
    `content_link` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `is_read` enum('0','1') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `password_resets`
  --
  
  CREATE TABLE `password_resets` (
    `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `token` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `rooms`
  --
  
  CREATE TABLE `rooms` (
    `id` int(10) UNSIGNED NOT NULL,
    `user_id` int(10) UNSIGNED NOT NULL,
    `type` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
    `no_of_floor` int(11) NOT NULL,
    `no_of_room` int(11) NOT NULL,
    `parking` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `kitchen` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `restroom` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `phone_no` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `loc_lat` double NOT NULL,
    `loc_lon` double NOT NULL,
    `address` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `preference` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `price` double NOT NULL,
    `description` text COLLATE utf8mb4_unicode_ci NOT NULL,
    `occupied` tinyint(1) 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;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `spam`
  --
  
  CREATE TABLE `spam` (
    `id` int(10) UNSIGNED NOT NULL,
    `user_id` int(10) UNSIGNED NOT NULL,
    `complains` text COLLATE utf8mb4_unicode_ci NOT NULL,
    `room_id` int(10) UNSIGNED DEFAULT NULL,
    `jagga_id` int(10) UNSIGNED DEFAULT NULL,
    `read` enum('0','1') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
    `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;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `userfavourites`
  --
  
  CREATE TABLE `userfavourites` (
    `id` int(10) UNSIGNED NOT NULL,
    `user_id` int(10) UNSIGNED NOT NULL,
    `room_id` int(10) UNSIGNED DEFAULT NULL,
    `jagga_id` 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 `users`
  --
  
  CREATE TABLE `users` (
    `id` int(10) UNSIGNED NOT NULL,
    `name` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `profile_pic` varchar(300) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `email` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
    `password` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `status` enum('active','inactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
    `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;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `user_sessions`
  --
  
  CREATE TABLE `user_sessions` (
    `id` int(10) UNSIGNED NOT NULL,
    `user_id` int(10) UNSIGNED NOT NULL,
    `device_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
    `device_id` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
    `access_token` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
    `fb_device_token` varchar(200) 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;
  
  --
  -- Indexes for dumped tables
  --
  
  --
  -- Indexes for table `feedback`
  --
  ALTER TABLE `feedback`
    ADD PRIMARY KEY (`id`),
    ADD KEY `feedback_user_id_foreign` (`user_id`);
  
  --
  -- Indexes for table `images`
  --
  ALTER TABLE `images`
    ADD PRIMARY KEY (`id`),
    ADD KEY `images_room_id_foreign` (`room_id`),
    ADD KEY `images_jagga_id_foreign` (`jagga_id`);
  
  --
  -- Indexes for table `jaggas`
  --
  ALTER TABLE `jaggas`
    ADD PRIMARY KEY (`id`),
    ADD KEY `jaggas_user_id_foreign` (`user_id`);
  
  --
  -- Indexes for table `logs`
  --
  ALTER TABLE `logs`
    ADD PRIMARY KEY (`id`),
    ADD KEY `logs_user_id_foreign` (`user_id`);
  
  --
  -- Indexes for table `migrations`
  --
  ALTER TABLE `migrations`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `notifications`
  --
  ALTER TABLE `notifications`
    ADD PRIMARY KEY (`id`),
    ADD KEY `notifications_user_id_foreign` (`user_id`);
  
  --
  -- Indexes for table `password_resets`
  --
  ALTER TABLE `password_resets`
    ADD KEY `password_resets_email_index` (`email`);
  
  --
  -- Indexes for table `rooms`
  --
  ALTER TABLE `rooms`
    ADD PRIMARY KEY (`id`),
    ADD KEY `rooms_user_id_foreign` (`user_id`);
  
  --
  -- Indexes for table `spam`
  --
  ALTER TABLE `spam`
    ADD PRIMARY KEY (`id`),
    ADD KEY `spam_user_id_foreign` (`user_id`),
    ADD KEY `spam_room_id_foreign` (`room_id`),
    ADD KEY `spam_jagga_id_foreign` (`jagga_id`);
  
  --
  -- Indexes for table `userfavourites`
  --
  ALTER TABLE `userfavourites`
    ADD PRIMARY KEY (`id`),
    ADD KEY `userfavourites_user_id_foreign` (`user_id`),
    ADD KEY `userfavourites_room_id_foreign` (`room_id`),
    ADD KEY `userfavourites_jagga_id_foreign` (`jagga_id`);
  
  --
  -- Indexes for table `users`
  --
  ALTER TABLE `users`
    ADD PRIMARY KEY (`id`),
    ADD UNIQUE KEY `users_email_unique` (`email`);
  
  --
  -- Indexes for table `user_sessions`
  --
  ALTER TABLE `user_sessions`
    ADD PRIMARY KEY (`id`),
    ADD KEY `user_sessions_user_id_foreign` (`user_id`);
  
  --
  -- AUTO_INCREMENT for dumped tables
  --
  
  --
  -- AUTO_INCREMENT for table `feedback`
  --
  ALTER TABLE `feedback`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
  --
  -- AUTO_INCREMENT for table `images`
  --
  ALTER TABLE `images`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
  --
  -- AUTO_INCREMENT for table `jaggas`
  --
  ALTER TABLE `jaggas`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
  --
  -- AUTO_INCREMENT for table `logs`
  --
  ALTER TABLE `logs`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
  --
  -- AUTO_INCREMENT for table `migrations`
  --
  ALTER TABLE `migrations`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=45;
  --
  -- AUTO_INCREMENT for table `notifications`
  --
  ALTER TABLE `notifications`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
  --
  -- AUTO_INCREMENT for table `rooms`
  --
  ALTER TABLE `rooms`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
  --
  -- AUTO_INCREMENT for table `spam`
  --
  ALTER TABLE `spam`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
  --
  -- AUTO_INCREMENT for table `userfavourites`
  --
  ALTER TABLE `userfavourites`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
  --
  -- AUTO_INCREMENT for table `users`
  --
  ALTER TABLE `users`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
  --
  -- AUTO_INCREMENT for table `user_sessions`
  --
  ALTER TABLE `user_sessions`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
  --
  -- Constraints for dumped tables
  --
  
  --
  -- Constraints for table `feedback`
  --
  ALTER TABLE `feedback`
    ADD CONSTRAINT `feedback_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);
  
  --
  -- Constraints for table `images`
  --
  ALTER TABLE `images`
    ADD CONSTRAINT `images_jagga_id_foreign` FOREIGN KEY (`jagga_id`) REFERENCES `jaggas` (`id`),
    ADD CONSTRAINT `images_room_id_foreign` FOREIGN KEY (`room_id`) REFERENCES `rooms` (`id`);
  
  --
  -- Constraints for table `jaggas`
  --
  ALTER TABLE `jaggas`
    ADD CONSTRAINT `jaggas_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);
  
  --
  -- Constraints for table `logs`
  --
  ALTER TABLE `logs`
    ADD CONSTRAINT `logs_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);
  
  --
  -- Constraints for table `notifications`
  --
  ALTER TABLE `notifications`
    ADD CONSTRAINT `notifications_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);
  
  --
  -- Constraints for table `rooms`
  --
  ALTER TABLE `rooms`
    ADD CONSTRAINT `rooms_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);
  
  --
  -- Constraints for table `spam`
  --
  ALTER TABLE `spam`
    ADD CONSTRAINT `spam_jagga_id_foreign` FOREIGN KEY (`jagga_id`) REFERENCES `jaggas` (`id`),
    ADD CONSTRAINT `spam_room_id_foreign` FOREIGN KEY (`room_id`) REFERENCES `rooms` (`id`),
    ADD CONSTRAINT `spam_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);
  
  --
  -- Constraints for table `userfavourites`
  --
  ALTER TABLE `userfavourites`
    ADD CONSTRAINT `userfavourites_jagga_id_foreign` FOREIGN KEY (`jagga_id`) REFERENCES `jaggas` (`id`),
    ADD CONSTRAINT `userfavourites_room_id_foreign` FOREIGN KEY (`room_id`) REFERENCES `rooms` (`id`),
    ADD CONSTRAINT `userfavourites_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);
  
  --
  -- Constraints for table `user_sessions`
  --
  ALTER TABLE `user_sessions`
    ADD CONSTRAINT `user_sessions_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);
  
  /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
  