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

START TRANSACTION;



--
-- Database: `vicmedia_earn`
--

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

--
-- Table structure for table `activity_bonus`
--

CREATE TABLE `activity_bonus` (
  `id` int(11) NOT NULL,
  `registration` longtext DEFAULT NULL,
  `login` longtext DEFAULT NULL,
  `comment` longtext DEFAULT NULL,
  `reading` longtext DEFAULT NULL,
  `referral` longtext DEFAULT NULL,
  `directbonus` longtext DEFAULT NULL,
  `referral_by_referral` longtext NOT NULL,
  `sponsored` longtext DEFAULT NULL,
  `payment_for_non_referral` longtext DEFAULT NULL,
  `payment_for_referral` longtext DEFAULT NULL,
  `no_of_post_view` int(11) DEFAULT NULL,
  `no_of_comment` int(11) DEFAULT NULL,
  `mlm_matix_1` int(11) NOT NULL DEFAULT 1,
  `mlm_matix_2` int(11) NOT NULL DEFAULT 1,
  `mlm_matrix_amount` int(11) NOT NULL DEFAULT 100,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `activity_bonus`
--

INSERT INTO `activity_bonus` (`id`, `registration`, `login`, `comment`, `reading`, `referral`, `directbonus`, `referral_by_referral`, `sponsored`, `payment_for_non_referral`, `payment_for_referral`, `no_of_post_view`, `no_of_comment`, `mlm_matix_1`, `mlm_matix_2`, `mlm_matrix_amount`, `created_at`, `updated_at`) VALUES
(1, '2000', '150', '50', '50', '1000', '200', '100', '200', '200', '500', 5, 5, 6, 4, 1500, '2020-12-30 00:08:18', '2022-07-23 20:33:32');

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

--
-- Table structure for table `dice_rolls`
--

CREATE TABLE `dice_rolls` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `roll` int(11) NOT NULL,
  `prize` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ads_managers`
--

CREATE TABLE `ads_managers` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `aboveHeader` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `belowHeader` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `afterTitle` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `inContent` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `BeforeComments` text COLLATE utf8mb4_unicode_ci 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 `payout_request_data`
--

CREATE TABLE `payout_request_data` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_tdatabal` int(11) NOT NULL,
  `is_payed` int(11) NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `name` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `number` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `network` text 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 `bundle`
--

CREATE TABLE `bundle` (
  `id` int(11) NOT NULL,
  `name` varchar(250) NOT NULL,
  `days` int(11) NOT NULL,
  `cat_id` int(11) DEFAULT NULL,
  `points` varchar(250) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


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

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

CREATE TABLE `categories` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `slug` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text 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;

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

INSERT INTO `categories` (`id`, `name`, `slug`, `description`, `created_at`, `updated_at`) VALUES
(18, 'Sponsored Post', 'sponsored-post', 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using \'Content here, content here\', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for \'lorem ipsum\' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).', '2020-07-25 02:09:19', '2020-07-25 02:09:19');

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

--
-- Table structure for table `category_treads`
--

CREATE TABLE `category_treads` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `cat_id` bigint(20) UNSIGNED NOT NULL DEFAULT 1,
  `tread_id` bigint(20) UNSIGNED 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 `comments`
--

CREATE TABLE `comments` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `tread_id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `parent_id` int(10) UNSIGNED DEFAULT NULL,
  `body` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `commentable_id` int(10) UNSIGNED NOT NULL,
  `commentable_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` int(10) UNSIGNED NOT NULL DEFAULT 1,
  `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 `coupon_codes`
--

CREATE TABLE `coupon_codes` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `plan` int(11) NOT NULL DEFAULT 1,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `vendor_id` int(11) DEFAULT NULL,
  `coupon_code` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_used` bigint(20) NOT NULL DEFAULT 2,
  `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 `wallets`
--

CREATE TABLE `wallets` (
	 `id` int(10) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
	 `user_id` int(11) NOT NULL,
	 `box` int(11) NOT NULL DEFAULT 0,
	 `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
	`updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `voucher`
--

CREATE TABLE `voucher` (
	 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
	 `user_id` bigint(20) unsigned NOT NULL,
	 `wallet_id` bigint(20) unsigned NOT NULL,
	 `voucher_code_id` bigint(20) unsigned NOT NULL,
	 `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
	`updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `voucher_codes`
--

CREATE TABLE `voucher_codes` (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `vendor_id` int(11) DEFAULT NULL,
  `voucher_code` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_used` bigint(20) NOT NULL DEFAULT 2,
  `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 `custom_script_footers`
--

CREATE TABLE `custom_script_footers` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `script` blob 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 `custom_script_headers`
--

CREATE TABLE `custom_script_headers` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `script` longtext COLLATE utf8mb4_unicode_ci 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 `custom_styles`
--

CREATE TABLE `custom_styles` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `style` longtext COLLATE utf8mb4_unicode_ci 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 `earning_history`
--

CREATE TABLE `earning_history` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `type` longtext NOT NULL,
  `amount` longtext NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `footer_links`
--

CREATE TABLE `footer_links` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `links` blob 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 `like_counts`
--

CREATE TABLE `like_counts` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `tread_id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED 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
(1, '2014_10_12_000000_create_users_table', 1),
(2, '2014_10_12_100000_create_password_resets_table', 1),
(3, '2019_04_17_221046_create_coupon_codes_table', 1),
(4, '2019_04_18_024438_create_pay_stack_logs_table', 1),
(5, '2019_04_18_162752_create_paid_members_table', 1),
(6, '2019_04_19_182107_create_treads_table', 1),
(7, '2019_04_19_205414_create_categories_table', 1),
(8, '2019_04_19_205443_create_category_treads_table', 1),
(9, '2019_04_19_210532_create_view_counts_table', 1),
(10, '2019_04_19_210606_create_like_counts_table', 1),
(11, '2019_04_20_120529_create_comments_table', 1),
(12, '2019_04_23_025222_create_supports_table', 1),
(13, '2019_04_24_013322_create_support_messages_table', 1),
(14, '2019_04_26_101446_create_general_settings_table', 1),
(15, '2019_04_26_102509_create_custom_styles_table', 1),
(16, '2019_04_26_102553_create_custom_script_headers_table', 1),
(17, '2019_04_26_102615_create_custom_script_footers_table', 1),
(18, '2019_04_26_102822_create_side_bar_settings_table', 1),
(19, '2019_04_26_125655_create_footer_links_table', 1),
(20, '2019_04_29_020214_create_site_notifcations_table', 1),
(21, '2019_04_29_204303_create_ads_managers_table', 1),
(22, '2019_04_29_231633_create_request_payouts_table', 1),
(23, '2019_04_29_231740_create_payout_requests_table', 1),
(24, '2019_05_02_133349_create_improvement_messages_table', 1);

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

--
-- Table structure for table `paid_members`
--

CREATE TABLE `paid_members` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `referred_by_id` bigint(20) UNSIGNED DEFAULT NULL,
  `payment_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `coupon_code_id` bigint(20) UNSIGNED DEFAULT NULL,
  `paystack_log_id` bigint(20) 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 `payout_requests`
--

CREATE TABLE `payout_requests` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `from_account` int(11) NOT NULL,
  `is_payed` int(11) NOT NULL,
  `name` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `activities_amount` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `account_number` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `account_name` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `bank_name` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `facebook_profile_link` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `activities_earning_account` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `Directbonus` int(11) DEFAULT NULL,
  `amount_paid` text COLLATE utf8mb4_unicode_ci 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 `pay_stack_logs`
--

CREATE TABLE `pay_stack_logs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `payer_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payment_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` int(11) NOT NULL DEFAULT 0,
  `description` longtext COLLATE utf8mb4_unicode_ci 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 `plans`
--

CREATE TABLE `plans` (
  `id` int(11) NOT NULL,
  `name` longtext NOT NULL,
  `amount` int(11) NOT NULL,
  `referral_bonus` int(11) NOT NULL,
  `indirect_bonus` int(11) NOT NULL,
  `registeration_bonus` int(11) NOT NULL,
  `sponsor_post` varchar(11) DEFAULT NULL,
  `login_bonus` varchar(11) DEFAULT NULL,
  `payment_for_referral` int(11) NOT NULL DEFAULT 0,
  `payment_for_non_referral` int(11) NOT NULL DEFAULT 0,
  `market_point` int(11) NOT NULL DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `reading_history`
--

CREATE TABLE `reading_history` (
  `id` int(11) NOT NULL,
  `tread_id` longtext NOT NULL,
  `user_id` int(11) NOT NULL,
  `status` int(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `request_payouts`
--

CREATE TABLE `request_payouts` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `status` int(11) NOT NULL,
  `wallet` int(1) NOT NULL DEFAULT 0,
  `allowi` int(1) NOT NULL DEFAULT 0,
  `walletallowi` int(1) DEFAULT 0,
  `wallet2` int(1) DEFAULT 0,
  `allowi2` int(1) DEFAULT 0,
  `walletallowi2` int(1) DEFAULT 0,
  `directbonus` int(11) 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;

--
-- Dumping data for table `request_payouts`
--

INSERT INTO `request_payouts` (`id`, `status`, `wallet`, `allowi`, `walletallowi`, `wallet2`, `allowi2`, `walletallowi2`, `directbonus`, `created_at`, `updated_at`) VALUES
(1, 1, 1, 1, 1, 1, 1, 1, 1, NULL, '2022-07-24 00:55:33');

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

--
-- Table structure for table `security_questions`
--

CREATE TABLE `security_questions` (
  `id` int(11) NOT NULL,
  `questions` longtext NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `security_questions`
--

INSERT INTO `security_questions` (`id`, `questions`, `created_at`, `updated_at`) VALUES
(1, 'What makes you cry?', '2020-08-05 07:40:30', '2020-08-05 07:40:30'),
(2, 'What is your native language?', '2020-08-05 07:40:30', '2020-08-05 07:40:30'),
(3, 'What is your favorite book?', '2020-08-05 07:40:30', '2020-08-05 07:40:30'),
(4, 'What is your worst habit?', '2020-08-05 07:40:30', '2020-08-05 07:40:30'),
(5, 'What food do you have a love-hate relationship with?', '2020-08-05 07:40:30', '2020-08-05 07:40:30'),
(6, 'What is your good luck charm?', '2020-08-05 07:40:30', '2020-08-05 07:40:30'),
(7, 'What is your best shower thought?', '2020-08-05 07:40:30', '2020-08-05 07:40:30'),
(8, 'What is your mother’s maiden name?', '2020-08-05 07:40:30', '2020-08-05 07:40:30'),
(9, 'What is the name of the road you grew up on?', '2020-08-05 07:40:30', '2020-08-05 07:40:30'),
(10, 'Where is your favorite place to vacation?', '2020-08-05 07:40:30', '2020-08-05 07:40:30');

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

--
-- Table structure for table `side_bar_settings`
--

CREATE TABLE `side_bar_settings` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `leftSidebar` blob DEFAULT NULL,
  `rightSidebar` blob 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 `site_how_it_work`
--

CREATE TABLE `site_how_it_work` (
  `id` int(11) NOT NULL,
  `content` longtext CHARACTER SET utf8 NOT NULL,
  `status` int(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `site_how_it_work`
--

INSERT INTO `site_how_it_work` (`id`, `content`, `status`, `created_at`, `updated_at`) VALUES
(1, 'testing', 1, '2020-08-06 12:46:03', '2022-07-24 16:22:18');

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

--
-- Table structure for table `site_notifcations`
--

CREATE TABLE `site_notifcations` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `content` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` int(11) NOT NULL DEFAULT 1,
  `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 `site_notifcations`
--

INSERT INTO `site_notifcations` (`id`, `content`, `status`, `created_at`, `updated_at`) VALUES
(1, 'testing', 1, '2020-04-15 19:06:18', '2022-06-28 09:10:24');

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

--
-- Table structure for table `sponsored_post_history`
--

CREATE TABLE `sponsored_post_history` (
  `id` int(11) NOT NULL,
  `tread_id` longtext NOT NULL,
  `user_id` int(11) NOT NULL,
  `status` int(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

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

CREATE TABLE `subscriptions` (
  `id` int(11) NOT NULL,
  `bundle_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `subscribed_on` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `expired_on` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `status` int(1) NOT NULL,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `supports`
--

CREATE TABLE `supports` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `title` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `content` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` int(10) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `attachment_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `reason` 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 `support_messages`
--

CREATE TABLE `support_messages` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `support_id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `message` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_read` int(10) UNSIGNED NOT NULL DEFAULT 0,
  `attachment_id` text COLLATE utf8mb4_unicode_ci 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 `top_earners`
--

CREATE TABLE `top_earners` (
  `id` int(11) NOT NULL,
  `content` longtext NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `transactions`
--

CREATE TABLE `transactions` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `type` longtext NOT NULL,
  `status` int(1) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `treads`
--

CREATE TABLE `treads` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `slug` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `featured_image` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `video_link` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `title` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `content` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_by` bigint(20) UNSIGNED NOT NULL,
  `status` bigint(20) UNSIGNED NOT NULL DEFAULT 1,
  `tread_source` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tread_source_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_tread` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT '1',
  `is_commentable` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT '1',
  `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_video_tread`
--

CREATE TABLE `user_video_tread` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `video_tread_id` bigint(20) NOT NULL,
  `user_id` bigint(20) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `vendor`
--

CREATE TABLE `vendor` (
  `id` int(11) NOT NULL,
  `fullname` longtext NOT NULL,
  `email` longtext NOT NULL,
  `phone` longtext NOT NULL,
  `birth` longtext DEFAULT NULL,
  `passport` longtext DEFAULT NULL,
  `status` int(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `video_treads`
--

CREATE TABLE `video_treads` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` int(11) NOT NULL,
  `min_view_seconds` int(11) NOT NULL,
  `video_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` tinyint(4) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `view_counts`
--

CREATE TABLE `view_counts` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `tread_id` bigint(20) UNSIGNED 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 `activity_bonus`
--
ALTER TABLE `activity_bonus`
  ADD PRIMARY KEY (`id`);
  
--
-- Indexes for table `dice_rolls`
--
ALTER TABLE `dice_rolls`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `user_roll_unique` (`user_id`,`created_at`);

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

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

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

--
-- Indexes for table `category_treads`
--
ALTER TABLE `category_treads`
  ADD PRIMARY KEY (`id`),
  ADD KEY `category_treads_cat_id_foreign` (`cat_id`),
  ADD KEY `category_treads_tread_id_foreign` (`tread_id`);

--
-- Indexes for table `comments`
--
ALTER TABLE `comments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `comments_tread_id_foreign` (`tread_id`),
  ADD KEY `comments_user_id_foreign` (`user_id`);

--
-- Indexes for table `coupon_codes`
--
ALTER TABLE `coupon_codes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `coupon_codes_user_id_foreign` (`user_id`) USING BTREE;

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

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

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

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

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

--
-- Indexes for table `like_counts`
--
ALTER TABLE `like_counts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `like_counts_tread_id_foreign` (`tread_id`),
  ADD KEY `like_counts_user_id_foreign` (`user_id`);

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

--
-- Indexes for table `paid_members`
--
ALTER TABLE `paid_members`
  ADD PRIMARY KEY (`id`),
  ADD KEY `paid_members_referred_by_id_foreign` (`referred_by_id`),
  ADD KEY `paid_members_coupon_code_id_foreign` (`coupon_code_id`),
  ADD KEY `paid_members_paystack_log_id_foreign` (`paystack_log_id`),
  ADD KEY `paid_members_user_id_index` (`user_id`);

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

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

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

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

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

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

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

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

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

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

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

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

--
-- Indexes for table `support_messages`
--
ALTER TABLE `support_messages`
  ADD PRIMARY KEY (`id`),
  ADD KEY `support_messages_support_id_foreign` (`support_id`),
  ADD KEY `support_messages_user_id_foreign` (`user_id`);

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

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

--
-- Indexes for table `treads`
--
ALTER TABLE `treads`
  ADD PRIMARY KEY (`id`),
  ADD KEY `treads_created_by_foreign` (`created_by`);

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

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

--
-- Indexes for table `video_treads`
--
ALTER TABLE `video_treads`
  ADD PRIMARY KEY (`id`),
  ADD KEY `status` (`status`);

--
-- Indexes for table `view_counts`
--
ALTER TABLE `view_counts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `view_counts_tread_id_foreign` (`tread_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `activity_bonus`
--
ALTER TABLE `activity_bonus`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
  
--
-- AUTO_INCREMENT for table `dice_rolls`
--
ALTER TABLE `dice_rolls`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
COMMIT;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

--
-- Constraints for dumped tables
--

--
-- Constraints for table `coupon_codes`
--
ALTER TABLE `coupon_codes`
  ADD CONSTRAINT `coupon_codes_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
  
--
-- Constraints for table `voucher_codes`
--
ALTER TABLE `voucher_codes`
  ADD CONSTRAINT `voucher_codes_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `like_counts`
--
ALTER TABLE `like_counts`
  ADD CONSTRAINT `like_counts_tread_id_foreign` FOREIGN KEY (`tread_id`) REFERENCES `treads` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `like_counts_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `paid_members`
--
ALTER TABLE `paid_members`
  ADD CONSTRAINT `paid_members_coupon_code_id_foreign` FOREIGN KEY (`coupon_code_id`) REFERENCES `coupon_codes` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `paid_members_paystack_log_id_foreign` FOREIGN KEY (`paystack_log_id`) REFERENCES `pay_stack_logs` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `paid_members_referred_by_id_foreign` FOREIGN KEY (`referred_by_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `paid_members_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `supports`
--
ALTER TABLE `supports`
  ADD CONSTRAINT `supports_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `support_messages`
--
ALTER TABLE `support_messages`
  ADD CONSTRAINT `support_messages_support_id_foreign` FOREIGN KEY (`support_id`) REFERENCES `supports` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `support_messages_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `treads`
--
ALTER TABLE `treads`
  ADD CONSTRAINT `treads_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `view_counts`
--
ALTER TABLE `view_counts`
  ADD CONSTRAINT `view_counts_tread_id_foreign` FOREIGN KEY (`tread_id`) REFERENCES `treads` (`id`) ON DELETE CASCADE;
COMMIT;

