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

START TRANSACTION;



--
-- Database: `cutommystgngs_checkers`
--

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

--
-- Table structure for table `customer_stripe_deposits`
--

CREATE TABLE `customer_stripe_deposits` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` int(11) NOT NULL,
  `amount` decimal(16,2) NOT NULL,
  `currency` varchar(3) NOT NULL,
  `customer_id` varchar(255) DEFAULT NULL,
  `charge_id` varchar(255) DEFAULT NULL,
  `payment_intent_id` varchar(255) DEFAULT NULL,
  `receipt_url` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `status` tinyint(11) DEFAULT 1,
  `created_at` datetime DEFAULT current_timestamp(),
  `updated_at` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `customer_stripe_deposits`
--

INSERT INTO `customer_stripe_deposits` (`id`, `user_id`, `amount`, `currency`, `customer_id`, `charge_id`, `payment_intent_id`, `receipt_url`, `description`, `status`, `created_at`, `updated_at`) VALUES
(3, 8, 1000.00, 'USD', 'cus_OIxtonNq1n9Caz', 'ch_3NWLxYDcUavgDqd52MKRXnx1', NULL, 'https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xTlBsZHpEY1VhdmdEcWQ1KLTd6qUGMgaGLx9-BdA6LBYy-2ED0VfGSgDzLdaT_h7BdSahV2su7y9Y1e7inI2T2WtqhTpgLEgOlbpq', 'Payment Deposit', 1, '2023-07-21 16:13:41', '2023-07-21 16:13:41'),
(4, 8, 1.00, 'USD', 'cus_OIxuK5vo7lG7Yv', 'ch_3NWLyIDcUavgDqd51E8Uncrs', NULL, 'https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xTlBsZHpEY1VhdmdEcWQ1KOLd6qUGMgaeBEFGz2E6LBZ4J8UTb_xKqe8H99vjwcWGLa2hu499_mImsqWeTnFjPu4DRdEhqkOQ7-vn', 'Payment Deposit', 1, '2023-07-21 16:14:28', '2023-07-21 16:14:28');

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

--
-- Table structure for table `faq`
--

CREATE TABLE `faq` (
  `id` int(11) NOT NULL,
  `question` varchar(255) NOT NULL,
  `ans` varchar(255) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `inquiry`
--

CREATE TABLE `inquiry` (
  `id` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `number` varchar(255) NOT NULL,
  `msg` text NOT NULL,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `created_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `match_rooms`
--

CREATE TABLE `match_rooms` (
  `id` bigint(20) NOT NULL,
  `user_one` int(11) NOT NULL,
  `user_two` int(11) DEFAULT NULL,
  `spectator_ids` varchar(255) DEFAULT NULL,
  `room_code` varchar(255) DEFAULT NULL,
  `code_status` tinyint(4) DEFAULT NULL COMMENT '0 = unused , 1 = used',
  `room_status` tinyint(4) DEFAULT NULL COMMENT '0 = inactive , 1 = active',
  `winner_id` int(11) DEFAULT NULL,
  `bet_amount` decimal(16,2) DEFAULT 5.00,
  `status` int(11) DEFAULT 1,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `match_rooms`
--

INSERT INTO `match_rooms` (`id`, `user_one`, `user_two`, `spectator_ids`, `room_code`, `code_status`, `room_status`, `winner_id`, `bet_amount`, `status`, `created_at`, `updated_at`) VALUES
(15, 2, 3, NULL, 'jJSNmDiO', 1, 0, 3, 5.00, 1, '2023-07-07 15:16:59', '2023-07-07 22:33:59'),
(16, 2, NULL, NULL, '71S35eWz', 0, 1, NULL, 25.00, 1, '2023-07-10 19:04:23', '2023-07-21 07:43:12');

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

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

CREATE TABLE `migrations` (
  `id` int(10) UNSIGNED NOT NULL,
  `migration` varchar(255) 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
(3, '2023_07_19_104653_create_subscriptions_table', 1),
(4, '2023_07_21_154018_create_customer_stripe_deposits_table', 2);

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

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

CREATE TABLE `subscriptions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `subscription_id` varchar(255) DEFAULT NULL,
  `payment_id` varchar(255) DEFAULT NULL,
  `customer_id` varchar(255) DEFAULT NULL,
  `amount` decimal(16,2) DEFAULT NULL,
  `starts_at` datetime DEFAULT NULL,
  `ends_at` datetime DEFAULT NULL,
  `response` longtext DEFAULT NULL,
  `status` varchar(255) DEFAULT '1',
  `created_at` datetime DEFAULT current_timestamp(),
  `updated_at` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `subscriptions` (`id`, `user_id`, `subscription_id`, `payment_id`, `customer_id`, `amount`, `starts_at`, `ends_at`, `response`, `status`, `created_at`, `updated_at`) VALUES
(27, 8, 'sub_1NW0WLDcUavgDqd5ihCu8W6G', NULL, 'cus_OIbjhUEHuJWJ2o', 14.99, '2023-07-20 17:20:09', '2023-08-20 17:20:09', 'Stripe\\Subscription JSON: {\n    \"id\": \"sub_1NW0WLDcUavgDqd5ihCu8W6G\",\n    \"object\": \"subscription\",\n    \"application\": null,\n    \"application_fee_percent\": null,\n    \"automatic_tax\": {\n        \"enabled\": false\n    },\n    \"billing_cycle_anchor\": 1689873609,\n    \"billing_thresholds\": null,\n    \"cancel_at\": null,\n    \"cancel_at_period_end\": false,\n    \"canceled_at\": null,\n    \"cancellation_details\": {\n        \"comment\": null,\n        \"feedback\": null,\n        \"reason\": null\n    },\n    \"collection_method\": \"charge_automatically\",\n    \"created\": 1689873609,\n    \"currency\": \"usd\",\n    \"current_period_end\": 1692552009,\n    \"current_period_start\": 1689873609,\n    \"customer\": \"cus_OIbjhUEHuJWJ2o\",\n    \"days_until_due\": null,\n    \"default_payment_method\": null,\n    \"default_source\": null,\n    \"default_tax_rates\": [],\n    \"description\": null,\n    \"discount\": null,\n    \"ended_at\": null,\n    \"items\": {\n        \"object\": \"list\",\n        \"data\": [\n            {\n                \"id\": \"si_OIbjJigh3extqA\",\n                \"object\": \"subscription_item\",\n                \"billing_thresholds\": null,\n                \"created\": 1689873610,\n                \"metadata\": [],\n                \"plan\": {\n                    \"id\": \"price_1NVcLTDcUavgDqd58CLDparY\",\n                    \"object\": \"plan\",\n                    \"active\": true,\n                    \"aggregate_usage\": null,\n                    \"amount\": 1499,\n                    \"amount_decimal\": \"1499\",\n                    \"billing_scheme\": \"per_unit\",\n                    \"created\": 1689780679,\n                    \"currency\": \"usd\",\n                    \"interval\": \"month\",\n                    \"interval_count\": 1,\n                    \"livemode\": false,\n                    \"metadata\": [],\n                    \"nickname\": null,\n                    \"product\": \"prod_OICkrAWd0IyGEB\",\n                    \"tiers_mode\": null,\n                    \"transform_usage\": null,\n                    \"trial_period_days\": null,\n                    \"usage_type\": \"licensed\"\n                },\n                \"price\": {\n                    \"id\": \"price_1NVcLTDcUavgDqd58CLDparY\",\n                    \"object\": \"price\",\n                    \"active\": true,\n                    \"billing_scheme\": \"per_unit\",\n                    \"created\": 1689780679,\n                    \"currency\": \"usd\",\n                    \"custom_unit_amount\": null,\n                    \"livemode\": false,\n                    \"lookup_key\": null,\n                    \"metadata\": [],\n                    \"nickname\": null,\n                    \"product\": \"prod_OICkrAWd0IyGEB\",\n                    \"recurring\": {\n                        \"aggregate_usage\": null,\n                        \"interval\": \"month\",\n                        \"interval_count\": 1,\n                        \"trial_period_days\": null,\n                        \"usage_type\": \"licensed\"\n                    },\n                    \"tax_behavior\": \"unspecified\",\n                    \"tiers_mode\": null,\n                    \"transform_quantity\": null,\n                    \"type\": \"recurring\",\n                    \"unit_amount\": 1499,\n                    \"unit_amount_decimal\": \"1499\"\n                },\n                \"quantity\": 1,\n                \"subscription\": \"sub_1NW0WLDcUavgDqd5ihCu8W6G\",\n                \"tax_rates\": []\n            }\n        ],\n        \"has_more\": false,\n        \"total_count\": 1,\n        \"url\": \"\\/v1\\/subscription_items?subscription=sub_1NW0WLDcUavgDqd5ihCu8W6G\"\n    },\n    \"latest_invoice\": \"in_1NW0WLDcUavgDqd5Ya0MsIwf\",\n    \"livemode\": false,\n    \"metadata\": [],\n    \"next_pending_invoice_item_invoice\": null,\n    \"on_behalf_of\": null,\n    \"pause_collection\": null,\n    \"payment_settings\": {\n        \"payment_method_options\": null,\n        \"payment_method_types\": null,\n        \"save_default_payment_method\": \"off\"\n    },\n    \"pending_invoice_item_interval\": null,\n    \"pending_setup_intent\": null,\n    \"pending_update\": null,\n    \"plan\": {\n        \"id\": \"price_1NVcLTDcUavgDqd58CLDparY\",\n        \"object\": \"plan\",\n        \"active\": true,\n        \"aggregate_usage\": null,\n        \"amount\": 1499,\n        \"amount_decimal\": \"1499\",\n        \"billing_scheme\": \"per_unit\",\n        \"created\": 1689780679,\n        \"currency\": \"usd\",\n        \"interval\": \"month\",\n        \"interval_count\": 1,\n        \"livemode\": false,\n        \"metadata\": [],\n        \"nickname\": null,\n        \"product\": \"prod_OICkrAWd0IyGEB\",\n        \"tiers_mode\": null,\n        \"transform_usage\": null,\n        \"trial_period_days\": null,\n        \"usage_type\": \"licensed\"\n    },\n    \"quantity\": 1,\n    \"schedule\": null,\n    \"start_date\": 1689873609,\n    \"status\": \"active\",\n    \"test_clock\": null,\n    \"transfer_data\": null,\n    \"trial_end\": null,\n    \"trial_settings\": {\n        \"end_behavior\": {\n            \"missing_payment_method\": \"create_invoice\"\n        }\n    },\n    \"trial_start\": null\n}', 'active', '2023-07-20 17:19:18', '2023-07-20 17:20:11');

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

--
-- Table structure for table `website`
--

CREATE TABLE `website` (
  `location` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `twitter` varchar(255) DEFAULT NULL,
  `linkedin` varchar(255) DEFAULT NULL,
  `instagram` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `website`
--

INSERT INTO `website` (`location`, `email`, `phone`, `twitter`, `linkedin`, `instagram`, `created_at`, `updated_at`) VALUES
('2005 Stokes Isle Apt. 896, Venaville 10010, USA', 'info@yourdomain.com', '(+68) 120034509', 'https://twitter.com/', 'https://linkedin.com/', 'https://instagram.com/', '2023-05-20 06:35:37', '2023-05-20 06:35:37');

--
-- Indexes for dumped tables
--

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

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

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

--
-- Indexes for table `match_rooms`
--
ALTER TABLE `match_rooms`
  ADD PRIMARY KEY (`id`),
  ADD KEY `user_one_id` (`user_one`),
  ADD KEY `user_two_id` (`user_two`),
  ADD KEY `winner_id` (`winner_id`);

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

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

--
-- AUTO_INCREMENT for dumped tables
--

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

--
-- AUTO_INCREMENT for table `faq`
--
ALTER TABLE `faq`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `inquiry`
--
ALTER TABLE `inquiry`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Constraints for dumped tables
--

--
-- Constraints for table `customer_stripe_deposits`
--
ALTER TABLE `customer_stripe_deposits`
  ADD CONSTRAINT `customer_stripe_deposits_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `match_rooms`
--
ALTER TABLE `match_rooms`
  ADD CONSTRAINT `user_one_id` FOREIGN KEY (`user_one`) REFERENCES `users` (`id`) ON DELETE NO ACTION,
  ADD CONSTRAINT `user_two_id` FOREIGN KEY (`user_two`) REFERENCES `users` (`id`) ON DELETE NO ACTION,
  ADD CONSTRAINT `winner_id` FOREIGN KEY (`winner_id`) REFERENCES `users` (`id`) ON DELETE NO ACTION;
COMMIT;

