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

START TRANSACTION;



--
-- Database: `nomadic_dev`
--

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

--
-- Table structure for table `currency`
--

CREATE TABLE IF NOT EXISTS `currency` (
  `id` int NOT NULL AUTO_INCREMENT,
  `currency` varchar(191) DEFAULT NULL,
  `rate` decimal(10,2) DEFAULT NULL,
  `date` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `currency`
--

INSERT INTO `currency` (`id`, `currency`, `rate`, `date`) VALUES
(1, 'AUD', '1.58', '2023-10-04 16:31:57'),
(2, 'EUR', '0.95', '2023-10-04 16:31:57');

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

--
-- Table structure for table `equipments`
--

CREATE TABLE IF NOT EXISTS `equipments` (
  `id` int NOT NULL AUTO_INCREMENT,
  `photo` int NOT NULL,
  `name` int NOT NULL,
  `category` int NOT NULL,
  `description` int NOT NULL,
  `serial_number` int NOT NULL,
  `price` int NOT NULL,
  `cost_per_day` int NOT NULL,
  `cost_per_hour` int NOT NULL,
  `receipt` int NOT NULL,
  `note` int NOT NULL,
  `manual` int NOT NULL,
  `manual_link` int NOT NULL,
  `specialist` int NOT NULL,
  `daily_rate` int NOT NULL,
  `hourly_rate` int NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

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

CREATE TABLE IF NOT EXISTS `failed_jobs` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `uuid` varchar(191) COLLATE utf8mb4_general_ci NOT NULL,
  `connection` text COLLATE utf8mb4_general_ci NOT NULL,
  `queue` text COLLATE utf8mb4_general_ci NOT NULL,
  `payload` longtext COLLATE utf8mb4_general_ci NOT NULL,
  `exception` longtext COLLATE utf8mb4_general_ci NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `gallery`
--

CREATE TABLE IF NOT EXISTS `gallery` (
  `id` int NOT NULL AUTO_INCREMENT,
  `type` varchar(50) DEFAULT NULL,
  `ref_id` int DEFAULT NULL,
  `image_url` varchar(191) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `gallery`
--

INSERT INTO `gallery` (`id`, `type`, `ref_id`, `image_url`, `created_at`, `updated_at`) VALUES
(1, 'location', 1, '1696736623.png', '2023-10-08 03:43:43', '2023-10-08 03:43:43'),
(2, 'location', 1, '1696736658.png', '2023-10-08 03:44:18', '2023-10-08 03:44:18'),
(3, 'location', 1, '1696736693.png', '2023-10-08 03:44:53', '2023-10-08 03:44:53'),
(4, 'location', 1, '1696780097.png', '2023-10-08 15:48:17', '2023-10-08 15:48:17');

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

--
-- Table structure for table `landing_pages`
--

CREATE TABLE IF NOT EXISTS `landing_pages` (
  `id` int NOT NULL AUTO_INCREMENT,
  `type` varchar(100) DEFAULT NULL,
  `location_id` int DEFAULT NULL,
  `banner_picture` varchar(191) DEFAULT NULL,
  `description` text,
  `studios` varchar(255) DEFAULT NULL,
  `our_crew` varchar(191) DEFAULT NULL,
  `address` text,
  `opening_hours` mediumtext,
  `phone` varchar(13) DEFAULT NULL,
  `email` varchar(100) DEFAULT NULL,
  `how_to_get_there` text,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `landing_pages`
--

INSERT INTO `landing_pages` (`id`, `type`, `location_id`, `banner_picture`, `description`, `studios`, `our_crew`, `address`, `opening_hours`, `phone`, `email`, `how_to_get_there`, `created_at`, `updated_at`) VALUES
(1, 'location', 1, '1696707241.png', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2023-10-07 18:18:00', '2023-10-07 19:34:01'),
(2, 'location', 1, '1696702777.png', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2023-10-07 18:19:37', '2023-10-07 18:19:37');

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

--
-- Table structure for table `language`
--

CREATE TABLE IF NOT EXISTS `language` (
  `id` int NOT NULL AUTO_INCREMENT,
  `language` varchar(191) NOT NULL,
  `iso_code` varchar(50) NOT NULL,
  `status` tinyint NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `language`
--

INSERT INTO `language` (`id`, `language`, `iso_code`, `status`) VALUES
(1, 'English', 'eg', 1),
(2, 'Spanish', 'sp', 1);

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

--
-- Table structure for table `location`
--

CREATE TABLE IF NOT EXISTS `location` (
  `id` int NOT NULL AUTO_INCREMENT,
  `location` varchar(191) NOT NULL,
  `created_at` timestamp NOT NULL,
  `updated_at` timestamp NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `location`
--

INSERT INTO `location` (`id`, `location`, `created_at`, `updated_at`) VALUES
(1, 'Bali', '2023-09-23 12:13:51', '2023-09-23 12:13:51'),
(2, 'Bangkok', '2023-09-23 12:14:36', '2023-09-24 02:48:52'),
(3, 'Mexico', '2023-09-23 12:15:13', '2023-09-23 12:15:13'),
(4, 'Costa Rica', '2023-09-23 12:15:13', '2023-09-23 12:15:13');

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

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

CREATE TABLE IF NOT EXISTS `migrations` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `migration` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `batch` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(8, '2019_05_03_000001_create_customer_columns', 4),
(3, '2019_05_03_000002_create_subscriptions_table', 2),
(4, '2019_05_03_000003_create_subscription_items_table', 2),
(5, '2019_08_19_000000_create_failed_jobs_table', 2),
(6, '2019_12_14_000001_create_personal_access_tokens_table', 2),
(7, '2023_09_13_222450_create_plans_table', 3);

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

--
-- Table structure for table `plans`
--

CREATE TABLE IF NOT EXISTS `plans` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_general_ci NOT NULL,
  `slug` varchar(191) COLLATE utf8mb4_general_ci NOT NULL,
  `stripe_plan` varchar(191) COLLATE utf8mb4_general_ci NOT NULL,
  `price` int NOT NULL,
  `frequency` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,
  `points` int NOT NULL,
  `num_of_guest` int NOT NULL,
  `advance_duration` int NOT NULL,
  `advance_frequency` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `plans`
--

INSERT INTO `plans` (`id`, `name`, `slug`, `stripe_plan`, `price`, `frequency`, `points`, `num_of_guest`, `advance_duration`, `advance_frequency`, `created_at`, `updated_at`) VALUES
(1, 'Guest', 'guest', '', 0, 'month', 0, 0, 0, '', '2023-09-13 13:00:00', NULL),
(2, 'Starving Artisit', 'starving-artist', 'price_1Nq5zgBfA6yrUxU00QrQXG2L', 1149, 'month', 10500, 1, 1, 'week', '2023-09-13 11:40:12', NULL),
(3, 'Up and coming', 'up-and-coming', 'price_1Nq63MBfA6yrUxU0j1TyeglI', 1899, 'month', 17500, 2, 1, 'month', '2023-09-12 13:00:00', NULL),
(4, 'Almost Famous', 'almost-famous', 'price_1Nq643BfA6yrUxU0jhgGkvy2', 2500, 'month', 2500, 4, 3, 'month', '2023-09-12 13:00:00', NULL);

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

--
-- Table structure for table `points`
--

CREATE TABLE IF NOT EXISTS `points` (
  `id` int NOT NULL AUTO_INCREMENT,
  `action` enum('MEMBERSHIP_CREDIT','POINTS_PURCHASED','POINTS_RECEIVED','POINTS_SENT','BOOK_EVENT') CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `receivedby_uuid` varchar(191) NOT NULL,
  `sentby_uuid` varchar(191) DEFAULT NULL,
  `invoice_id` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  `plan_id` int DEFAULT NULL,
  `booking_id` varchar(191) DEFAULT NULL,
  `credit` int DEFAULT NULL,
  `debit` int DEFAULT NULL,
  `balance` int NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `points`
--

INSERT INTO `points` (`id`, `action`, `receivedby_uuid`, `sentby_uuid`, `invoice_id`, `plan_id`, `booking_id`, `credit`, `debit`, `balance`, `created_at`, `updated_at`) VALUES
(1, 'MEMBERSHIP_CREDIT', '06238d85-b98e-4ee2-8944-17cb87274117', NULL, 'in_1O159aBfA6yrUxU0E4FST3B0', 2, NULL, 10500, NULL, 10500, '2023-10-14 11:51:23', '2023-10-14 11:51:23'),
(2, 'POINTS_RECEIVED', 'b12e7acb-9d91-4628-aabd-3a82c039d5c1', '06238d85-b98e-4ee2-8944-17cb87274117', NULL, NULL, NULL, 10, NULL, 10, '2023-10-14 12:30:29', '2023-10-14 12:30:29'),
(3, 'POINTS_SENT', '06238d85-b98e-4ee2-8944-17cb87274117', 'b12e7acb-9d91-4628-aabd-3a82c039d5c1', NULL, NULL, NULL, NULL, 10, 10490, '2023-10-14 12:30:29', '2023-10-14 12:30:29');

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

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

CREATE TABLE IF NOT EXISTS `roles` (
  `role_id` int NOT NULL AUTO_INCREMENT,
  `role_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `role_slug` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `type` varchar(50) DEFAULT NULL,
  `status` int DEFAULT '1',
  PRIMARY KEY (`role_id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `roles`
--

INSERT INTO `roles` (`role_id`, `role_name`, `role_slug`, `type`, `status`) VALUES
(1, 'Super Admin', 'super-admin', 'no-access', 1),
(2, 'admin', 'admin', 'access', 1),
(3, 'Location Manager', 'location-manager', 'access', 1),
(4, 'Content Manager', 'content-manager', 'access', 1),
(5, 'Event Manager', 'event-manager', 'access', 1),
(6, 'Rental Manager', 'rental-manager', 'access', 1),
(7, 'Member', 'member', 'usertype', 1),
(8, 'Guest', 'guest', 'usertype', 1),
(9, 'Audio Engineer', 'audio-engineer', 'resource', 1),
(10, 'Audio Technician', 'audio-technician', 'resource', 1),
(11, 'Camera Operator', 'camera-operator', 'resource', 1),
(12, 'Mastering Engineer', 'mastering-engineer', 'resource', 1),
(13, 'Photographer', 'photographer', 'resource', 1),
(14, 'Production Assistant', 'production-assistant', 'resource', 1);

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

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

CREATE TABLE IF NOT EXISTS `subscriptions` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `user_id` bigint UNSIGNED NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_general_ci NOT NULL,
  `stripe_id` varchar(191) COLLATE utf8mb4_general_ci NOT NULL,
  `stripe_status` varchar(191) COLLATE utf8mb4_general_ci NOT NULL,
  `stripe_price` varchar(191) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `quantity` int DEFAULT NULL,
  `trial_ends_at` timestamp NULL DEFAULT NULL,
  `ends_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `subscriptions_stripe_id_unique` (`stripe_id`),
  KEY `subscriptions_user_id_stripe_status_index` (`user_id`,`stripe_status`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `subscriptions`
--

INSERT INTO `subscriptions` (`id`, `user_id`, `name`, `stripe_id`, `stripe_status`, `stripe_price`, `quantity`, `trial_ends_at`, `ends_at`, `created_at`, `updated_at`) VALUES
(1, 7, 'starving-artist', 'sub_1O159ZBfA6yrUxU0u1IFlrC0', 'active', 'price_1Nq5zgBfA6yrUxU00QrQXG2L', 1, NULL, '2023-11-14 10:33:05', '2023-10-14 10:33:07', '2023-10-14 10:38:48');

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

--
-- Table structure for table `subscription_items`
--

CREATE TABLE IF NOT EXISTS `subscription_items` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `subscription_id` bigint UNSIGNED NOT NULL,
  `stripe_id` varchar(191) COLLATE utf8mb4_general_ci NOT NULL,
  `stripe_product` varchar(191) COLLATE utf8mb4_general_ci NOT NULL,
  `stripe_price` varchar(191) COLLATE utf8mb4_general_ci NOT NULL,
  `quantity` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `subscription_items_subscription_id_stripe_price_unique` (`subscription_id`,`stripe_price`),
  UNIQUE KEY `subscription_items_stripe_id_unique` (`stripe_id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `subscription_items`
--

INSERT INTO `subscription_items` (`id`, `subscription_id`, `stripe_id`, `stripe_product`, `stripe_price`, `quantity`, `created_at`, `updated_at`) VALUES
(1, 1, 'si_OoiarUqkXunVr4', 'prod_OdMjcrQGxKW20w', 'price_1Nq5zgBfA6yrUxU00QrQXG2L', 1, '2023-10-14 10:33:07', '2023-10-14 10:33:07');

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

--
-- Table structure for table `user_permissions`
--

CREATE TABLE IF NOT EXISTS `user_permissions` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_uuid` varchar(191) DEFAULT NULL,
  `location_id` int NOT NULL,
  `role_id` int NOT NULL,
  `pages` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci,
  `created_At` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `user_permissions`
--

INSERT INTO `user_permissions` (`id`, `user_uuid`, `location_id`, `role_id`, `pages`, `created_At`, `updated_at`) VALUES
(8, '06238d85-b98e-4ee2-8944-17cb87274117', 1, 4, 'location-landing-page,studio-landing-page', '2023-10-13 09:07:58', '2023-10-13 09:07:58'),
(7, '06238d85-b98e-4ee2-8944-17cb87274117', 1, 3, 'location-landing-page,studio-landing-page', '2023-10-13 09:07:58', '2023-10-13 09:07:58');
COMMIT;

