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

START TRANSACTION;



--
-- Database: `lovekbkg_recomm`
--

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

--
-- Table structure for table `contact_us`
--

CREATE TABLE `contact_us` (
  `id` int(11) NOT NULL,
  `name` text DEFAULT NULL,
  `email` text DEFAULT NULL,
  `phone` text DEFAULT NULL,
  `subject` text DEFAULT NULL,
  `message` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `orders`
--

CREATE TABLE `orders` (
  `id` int(11) NOT NULL,
  `userid` int(11) NOT NULL,
  `subscriptionid` int(11) NOT NULL,
  `heading` text DEFAULT NULL,
  `price` text DEFAULT NULL,
  `records` text DEFAULT NULL,
  `payment_status` enum('paid','unpaid') NOT NULL DEFAULT 'unpaid',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `orders`
--

INSERT INTO `orders` (`id`, `userid`, `subscriptionid`, `heading`, `price`, `records`, `payment_status`, `created_at`, `updated_at`) VALUES
(8, 106, 3, 'Basic', '9.99', '50', 'paid', '2024-08-08 22:50:19', '2024-08-12 17:33:41');

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

--
-- Table structure for table `records`
--

CREATE TABLE `records` (
  `id` int(11) NOT NULL,
  `userid` int(11) NOT NULL,
  `name` text DEFAULT NULL,
  `phone` text DEFAULT NULL,
  `address` text DEFAULT NULL,
  `postal_code` text DEFAULT NULL,
  `state` text DEFAULT NULL,
  `city` text DEFAULT NULL,
  `mls_number` text DEFAULT NULL,
  `commission` text DEFAULT NULL,
  `type` text DEFAULT NULL,
  `status` enum('0','1') NOT NULL DEFAULT '1',
  `price` text DEFAULT NULL,
  `payment_status` enum('paid','unpaid') DEFAULT NULL,
  `record_type` enum('subscription','withoutsubscription') DEFAULT NULL,
  `bulk` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `records`
--

INSERT INTO `records` (`id`, `userid`, `name`, `phone`, `address`, `postal_code`, `state`, `city`, `mls_number`, `commission`, `type`, `status`, `price`, `payment_status`, `record_type`, `bulk`, `created_at`, `updated_at`) VALUES
(10, 106, 'Cassandra Bright', '+1 (453) 996-5177', 'Laborum nisi delect', '53', 'Officia mollitia dig', 'Totam sit et irure s', '675', '35', '%', '1', '1', 'paid', 'withoutsubscription', NULL, '2024-08-08 22:47:04', '2024-08-12 08:27:28'),
(11, 106, 'Cairo Pugh', '+1 (474) 333-7485', 'Laborum quam similiq', '45', 'Ad eu in repellendus', 'Velit aute et dolore', '404', '95', '$', '1', '1', 'paid', 'withoutsubscription', NULL, '2024-08-08 22:47:33', '2024-08-12 08:23:50'),
(12, 106, 'Ruth Stephens', '+1 (389) 124-3868', 'Rerum rerum modi ut', '25', 'Cillum proident aut', 'Optio aute odio sun', '582', '93', '%', '1', NULL, NULL, 'subscription', NULL, '2024-08-08 22:50:36', '2024-08-08 22:50:36');

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

--
-- Table structure for table `stripe_customers`
--

CREATE TABLE `stripe_customers` (
  `id` int(11) NOT NULL,
  `user_id` text DEFAULT NULL,
  `customer_id` text DEFAULT NULL,
  `subscription_id` text DEFAULT NULL,
  `orderid` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `stripe_customers`
--

INSERT INTO `stripe_customers` (`id`, `user_id`, `customer_id`, `subscription_id`, `orderid`, `created_at`, `updated_at`) VALUES
(2, '102', 'cus_QchnID5hDB0O3m', '7', '3', '2024-08-08 13:11:23', '2024-08-08 13:11:23'),
(3, '102', 'cus_QcpLdmojBMN5J8', '3', '4', '2024-08-08 20:59:24', '2024-08-08 20:59:24'),
(4, '106', 'cus_QcpmOz7lqye9Wl', '6', '5', '2024-08-08 21:26:55', '2024-08-08 21:26:55'),
(5, '106', 'cus_QcqMGJOx21Xu9y', '3', '6', '2024-08-08 22:03:00', '2024-08-08 22:03:00'),
(6, '106', 'cus_Qcr6d9y3MFpLVh', '3', '7', '2024-08-08 22:49:14', '2024-08-08 22:49:14'),
(7, '106', 'cus_Qcr7V0Q9ENp4E4', '3', '8', '2024-08-08 22:50:19', '2024-08-08 22:50:19');

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

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

CREATE TABLE `subscriptions` (
  `id` int(11) NOT NULL,
  `heading` text DEFAULT NULL,
  `price` text DEFAULT NULL,
  `records` text DEFAULT NULL,
  `slug` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `subscriptions` (`id`, `heading`, `price`, `records`, `slug`, `created_at`, `updated_at`) VALUES
(3, 'Basic', '9.99', '50', 'basic', '2024-08-07 03:14:13', '2024-08-07 03:14:13'),
(6, 'Advanced', '20', '100', 'advanced', '2024-08-07 03:30:11', '2024-08-07 03:30:11'),
(7, 'Premium', '50', '500', 'premium', '2024-08-07 03:30:36', '2024-08-07 03:30:36'),
(500, 'Custom', '1', '1', 'custom', '2024-08-07 03:35:44', '2024-08-08 18:40:12');

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

--
-- Table structure for table `subscriptions_detail`
--

CREATE TABLE `subscriptions_detail` (
  `id` int(11) NOT NULL,
  `subscriptionid` int(11) NOT NULL,
  `detail` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `subscriptions_detail`
--

INSERT INTO `subscriptions_detail` (`id`, `subscriptionid`, `detail`, `created_at`, `updated_at`) VALUES
(1, 3, 'Access to basic support', '2024-08-07 08:14:13', NULL),
(2, 3, 'Monthly data backup', '2024-08-07 08:14:13', NULL),
(3, 3, 'Free search access', '2024-08-07 08:14:13', NULL),
(8, 6, 'Priority support', '2024-08-07 08:30:11', NULL),
(9, 6, 'Weekly data backup', '2024-08-07 08:30:11', NULL),
(10, 6, 'Free search access', '2024-08-07 08:30:11', NULL),
(11, 7, '24/7 dedicated support', '2024-08-07 08:30:36', NULL),
(12, 7, 'Daily data backup', '2024-08-07 08:30:36', NULL),
(13, 7, 'Free search access', '2024-08-07 08:30:36', NULL),
(23, 500, 'Price per record', '2024-08-08 17:17:37', NULL),
(24, 500, 'Monthly data backup', '2024-08-08 17:17:37', NULL),
(25, 500, 'Free search access', '2024-08-08 17:17:37', NULL);

--
-- Indexes for dumped tables
--

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

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

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

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

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

--
-- Indexes for table `subscriptions_detail`
--
ALTER TABLE `subscriptions_detail`
  ADD PRIMARY KEY (`id`),
  ADD KEY `subscriptionid` (`subscriptionid`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `contact_us`
--
ALTER TABLE `contact_us`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;

--
-- AUTO_INCREMENT for table `orders`
--
ALTER TABLE `orders`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `records`
--
ALTER TABLE `records`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26;

--
-- AUTO_INCREMENT for table `stripe_customers`
--
ALTER TABLE `stripe_customers`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `subscriptions`
--
ALTER TABLE `subscriptions`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=502;

--
-- AUTO_INCREMENT for table `subscriptions_detail`
--
ALTER TABLE `subscriptions_detail`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `subscriptions_detail`
--
ALTER TABLE `subscriptions_detail`
  ADD CONSTRAINT `subscriptions_detail_ibfk_1` FOREIGN KEY (`subscriptionid`) REFERENCES `subscriptions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;

