-- phpMyAdmin SQL Dump
-- version 5.2.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Apr 10, 2026 at 01:41 AM
-- Server version: 11.4.10-MariaDB-cll-lve
-- PHP Version: 8.3.30

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
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: `kiliqshp_python`
--

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

--
-- Table structure for table `account_logs`
--

CREATE TABLE `account_logs` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `type` enum('income','expense') NOT NULL COMMENT 'income or expense',
  `category` varchar(50) DEFAULT 'other' COMMENT 'task, referral, commission, deposit, withdraw, plan',
  `amount` decimal(12,4) NOT NULL DEFAULT 0.0000,
  `description` varchar(255) DEFAULT NULL,
  `created_at` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

--
-- Dumping data for table `account_logs`
--

INSERT INTO `account_logs` (`id`, `user_id`, `type`, `category`, `amount`, `description`, `created_at`) VALUES
(1, 1, 'income', 'deposit', 2000.0000, 'Deposit via M-Pesa – pending approval', '2026-04-05 15:12:18'),
(2, 1, 'income', 'deposit', 2000.0000, 'Deposit approved – M-Pesa', '2026-04-05 15:18:28'),
(3, 1, 'income', 'deposit', 2000.0000, 'Deposit via M-Pesa – pending approval', '2026-04-05 15:18:38'),
(4, 1, 'income', 'deposit', 2000.0000, 'Deposit via M-Pesa – pending approval', '2026-04-05 15:19:29'),
(5, 1, 'expense', 'withdraw', 1000.0000, 'Withdrawal request via M-Pesa – pending', '2026-04-06 09:16:58'),
(6, 1, 'expense', 'withdraw', 1000.0000, 'Withdrawal request via M-Pesa – pending', '2026-04-06 09:17:12'),
(7, 1, 'expense', 'withdraw', 1000.0000, 'Withdrawal request via M-Pesa – pending', '2026-04-06 09:27:51'),
(8, 1, 'income', 'withdraw', 1000.0000, 'Withdrawal #1 rejected – refunded', '2026-04-06 09:28:25'),
(9, 1, 'income', 'withdraw', 1000.0000, 'Withdrawal #2 rejected – refunded', '2026-04-06 09:28:32'),
(10, 1, 'expense', 'withdraw', 980.0000, 'Withdrawal approved – M-Pesa → 09876542312', '2026-04-06 09:28:56'),
(11, 1, 'income', 'task', 25.0000, 'Task reward: zebran', '2026-04-09 02:21:59'),
(12, 1, 'income', 'task', 25.0000, 'Task reward: the way you move', '2026-04-09 02:22:17'),
(13, 1, 'income', 'task', 25.0000, 'Task reward: fly', '2026-04-09 02:22:48'),
(14, 1, 'income', 'task', 25.0000, 'Task reward: kids fighting', '2026-04-09 02:23:06'),
(15, 1, 'income', 'task', 25.0000, 'Task reward: the way you move', '2026-04-09 03:11:39'),
(16, 1, 'income', 'task', 25.0000, 'Task reward: fly', '2026-04-09 03:14:28'),
(17, 1, 'income', 'task', 25.0000, 'Task reward: play', '2026-04-09 03:27:09'),
(18, 1, 'income', 'task', 25.0000, 'Task reward: kids fighting', '2026-04-09 03:32:33'),
(19, 1, 'income', 'task', 25.0000, 'Task reward: play', '2026-04-09 03:33:20'),
(20, 1, 'income', 'task', 25.0000, 'Task reward: the way you move', '2026-04-09 08:04:56'),
(21, 1, 'income', 'task', 25.0000, 'Task reward: play', '2026-04-09 08:05:07'),
(22, 1, 'income', 'task', 25.0000, 'Task reward: shack', '2026-04-09 08:05:21'),
(23, 1, 'income', 'task', 25.0000, 'Task reward: Skale', '2026-04-09 08:49:41'),
(24, 1, 'income', 'task', 25.0000, 'Task reward: Skale', '2026-04-09 11:57:46'),
(25, 1, 'income', 'task', 25.0000, 'Task reward: fly', '2026-04-09 11:57:58'),
(26, 1, 'income', 'task', 25.0000, 'Task reward: kids fighting', '2026-04-09 11:58:08'),
(27, 8, 'income', 'task', 0.3000, 'Task reward: Skale', '2026-04-09 15:45:12'),
(28, 8, 'income', 'task', 0.3000, 'Task reward: zebran', '2026-04-09 15:45:36'),
(29, 8, 'income', 'task', 0.3000, 'Task reward: fly', '2026-04-09 15:45:50'),
(30, 1, 'income', 'deposit', 2000.0000, 'Deposit via M-Pesa – pending approval', '2026-04-09 22:58:38'),
(31, 9, 'income', 'deposit', 5000.0000, 'Deposit via M-Pesa – pending approval', '2026-04-10 00:08:38'),
(32, 9, 'income', 'deposit_approved', 5000.0000, 'Deposit approved – M-Pesa', '2026-04-10 00:09:43'),
(33, 9, 'income', 'task', 0.3000, 'Task reward: zebran', '2026-04-10 00:11:35'),
(34, 10, 'income', 'task', 0.3000, 'Task reward: Skale', '2026-04-10 00:21:48'),
(35, 10, 'income', 'task', 0.3000, 'Task reward: play', '2026-04-10 00:22:10'),
(36, 10, 'income', 'deposit', 10000.0000, 'Deposit via M-Pesa – pending approval', '2026-04-10 00:26:20'),
(37, 10, 'income', 'deposit_approved', 10000.0000, 'Deposit approved – M-Pesa', '2026-04-10 00:26:39'),
(38, 10, 'income', 'task', 8.0000, 'Task reward: play', '2026-04-10 00:30:21'),
(39, 10, 'income', 'task', 8.0000, 'Task reward: play', '2026-04-10 01:06:48'),
(40, 9, 'income', 'commission', 0.4000, 'L1 task commission: user #10 watched \'play\'', '2026-04-10 01:06:48'),
(41, 9, 'income', 'referral', 200.0000, 'L1 referral commission — user #10 joined F6', '2026-04-10 01:09:31');

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

--
-- Table structure for table `admin_users`
--

CREATE TABLE `admin_users` (
  `id` int(11) NOT NULL,
  `username` varchar(100) NOT NULL,
  `password` varchar(255) NOT NULL,
  `name` varchar(150) DEFAULT 'Administrator',
  `created_at` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

--
-- Dumping data for table `admin_users`
--

INSERT INTO `admin_users` (`id`, `username`, `password`, `name`, `created_at`) VALUES
(1, 'admin', '$2y$10$ChSGWkJLGKCA0obVJorQBO25DRTFs66QUHi98sFiLup0rm1NSKSku', 'Super Admin', '2026-04-04 05:33:47');

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

--
-- Table structure for table `commission_logs`
--

CREATE TABLE `commission_logs` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL COMMENT 'Upliner who receives',
  `from_user_id` int(11) NOT NULL COMMENT 'Downliner who triggered',
  `type` enum('referral','task') NOT NULL COMMENT 'referral=join reward, task=task completion reward',
  `level` tinyint(1) NOT NULL COMMENT '1, 2 or 3',
  `amount` decimal(10,4) DEFAULT 0.0000,
  `description` varchar(255) DEFAULT NULL,
  `created_at` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

--
-- Dumping data for table `commission_logs`
--

INSERT INTO `commission_logs` (`id`, `user_id`, `from_user_id`, `type`, `level`, `amount`, `description`, `created_at`) VALUES
(1, 9, 10, 'task', 1, 0.4000, 'L1 task commission: user #10 watched \'play\'', '2026-04-10 01:06:48'),
(2, 9, 10, 'referral', 1, 200.0000, 'L1 referral commission — user #10 joined F6', '2026-04-10 01:09:31');

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

--
-- Table structure for table `daily_profit_credits`
--

CREATE TABLE `daily_profit_credits` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `investment_id` int(11) NOT NULL,
  `amount` decimal(12,2) NOT NULL DEFAULT 0.00,
  `type` enum('daily_profit','maturity_bonus') NOT NULL DEFAULT 'daily_profit',
  `credited_at` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

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

--
-- Table structure for table `deposits`
--

CREATE TABLE `deposits` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `amount` decimal(12,4) NOT NULL,
  `method` varchar(80) NOT NULL COMMENT 'e.g. M-Pesa, USDT, Bank',
  `account_ref` varchar(255) DEFAULT NULL COMMENT 'Phone / wallet / account number',
  `txn_ref` varchar(255) DEFAULT NULL COMMENT 'Transaction ID from sender',
  `proof_path` varchar(500) DEFAULT NULL COMMENT 'Screenshot path',
  `status` enum('pending','approved','rejected') NOT NULL DEFAULT 'pending',
  `admin_note` varchar(255) DEFAULT NULL,
  `created_at` datetime DEFAULT current_timestamp(),
  `updated_at` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `approved_at` datetime DEFAULT NULL,
  `reject_note` varchar(500) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `deposits`
--

INSERT INTO `deposits` (`id`, `user_id`, `amount`, `method`, `account_ref`, `txn_ref`, `proof_path`, `status`, `admin_note`, `created_at`, `updated_at`, `approved_at`, `reject_note`) VALUES
(1, 1, 2000.0000, 'M-Pesa', '', '', 'uploads/proofs/dep_1_1775416338.jpg', 'approved', NULL, '2026-04-05 15:12:18', '2026-04-05 15:18:28', NULL, NULL),
(4, 1, 2000.0000, 'M-Pesa', '', '', 'uploads/proofs/dep_1_1775789918_fb8ca179.png', 'rejected', NULL, '2026-04-09 22:58:38', '2026-04-09 23:28:50', '2026-04-09 23:28:50', ',nm'),
(5, 9, 5000.0000, 'M-Pesa', '', '', 'uploads/proofs/dep_9_1775794118_8df81739.jpg', 'approved', NULL, '2026-04-10 00:08:38', '2026-04-10 00:09:43', '2026-04-10 00:09:43', NULL),
(6, 10, 10000.0000, 'M-Pesa', '', '', 'uploads/proofs/dep_10_1775795180_77297750.jpg', 'approved', NULL, '2026-04-10 00:26:20', '2026-04-10 00:26:39', '2026-04-10 00:26:39', NULL);

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

--
-- Table structure for table `investments`
--

CREATE TABLE `investments` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `plan_id` int(11) NOT NULL,
  `plan_name` varchar(100) DEFAULT NULL,
  `amount` decimal(12,4) NOT NULL,
  `daily_rate` decimal(5,2) NOT NULL,
  `cycle_days` int(5) NOT NULL,
  `total_return` decimal(14,4) DEFAULT 0.0000,
  `earned_so_far` decimal(14,4) DEFAULT 0.0000,
  `status` enum('active','completed','cancelled') DEFAULT 'active',
  `started_at` datetime DEFAULT current_timestamp(),
  `ends_at` datetime DEFAULT NULL,
  `last_credited_at` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

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

--
-- Table structure for table `investment_plans`
--

CREATE TABLE `investment_plans` (
  `id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `min_amount` decimal(12,2) NOT NULL DEFAULT 1000.00,
  `max_amount` decimal(12,2) NOT NULL DEFAULT 100000.00,
  `daily_rate` decimal(5,2) NOT NULL DEFAULT 2.00,
  `cycle_days` int(5) NOT NULL DEFAULT 365,
  `color_from` varchar(20) NOT NULL DEFAULT '#3eaabb',
  `color_to` varchar(20) NOT NULL DEFAULT '#92c7dd',
  `badge_img` varchar(255) DEFAULT '',
  `description` varchar(500) DEFAULT NULL,
  `active` tinyint(1) DEFAULT 1,
  `sort_order` int(5) DEFAULT 0,
  `created_at` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

--
-- Dumping data for table `investment_plans`
--

INSERT INTO `investment_plans` (`id`, `name`, `min_amount`, `max_amount`, `daily_rate`, `cycle_days`, `color_from`, `color_to`, `badge_img`, `description`, `active`, `sort_order`, `created_at`) VALUES
(1, 'Starter', 1000.00, 10000.00, 1.50, 30, '#7f8fa6', '#a4b2c4', '', NULL, 1, 0, '2026-04-05 06:14:39'),
(2, 'Silver', 5000.00, 50000.00, 2.00, 60, '#3eaabb', '#92c7dd', '', NULL, 1, 1, '2026-04-05 06:14:39'),
(3, 'Gold', 10000.00, 100000.00, 2.50, 90, '#f39c12', '#e67e22', '', NULL, 1, 2, '2026-04-05 06:14:39'),
(4, 'Platinum', 50000.00, 500000.00, 3.00, 180, '#8e44ad', '#e91e63', '', NULL, 1, 3, '2026-04-05 06:14:39');

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

--
-- Table structure for table `payment_methods`
--

CREATE TABLE `payment_methods` (
  `id` int(11) NOT NULL,
  `name` varchar(80) NOT NULL COMMENT 'M-Pesa, USDT TRC20, Bank…',
  `icon_url` varchar(500) DEFAULT NULL,
  `details` text DEFAULT NULL COMMENT 'Instructions shown to user',
  `account_no` varchar(255) DEFAULT NULL COMMENT 'Company account to send to',
  `active` tinyint(1) DEFAULT 1,
  `sort_order` int(5) DEFAULT 0,
  `created_at` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `payment_methods`
--

INSERT INTO `payment_methods` (`id`, `name`, `icon_url`, `details`, `account_no`, `active`, `sort_order`, `created_at`) VALUES
(1, 'M-Pesa', 'https://api.wfmtr.me/static/api/images/icon/mpesa.png', 'Send to number: <strong>0700 000 000</strong><br>Name: WFM Tanzania Ltd<br>After sending, enter your M-Pesa transaction ID below.', '0700000000', 1, 0, '2026-04-05 11:45:58'),
(2, 'USDT (TRC20)', 'https://api.wfmtr.me/static/api/images/icon/usdt.png', 'Send USDT to TRC20 wallet:<br><strong>TXxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</strong><br>Minimum: 10 USDT. Enter your TxHash below.', 'TXxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 1, 1, '2026-04-05 11:45:58'),
(3, 'Bank Transfer', 'https://api.wfmtr.me/static/api/images/icon/bank.png', 'Bank: CRDB Bank<br>Account: <strong>0152-123456-000</strong><br>Name: WFM Tanzania Ltd<br>Enter bank reference below.', '0152123456000', 1, 2, '2026-04-05 11:45:58'),
(4, 'MTN', 'uploads/method_icons/method_1775791946.png', 'Send to 076000000 name is navous kamau', '076000000', 1, 0, '2026-04-09 23:32:26');

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

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

CREATE TABLE `plans` (
  `id` int(11) NOT NULL,
  `name` varchar(50) NOT NULL,
  `slug` varchar(20) NOT NULL,
  `price` decimal(10,2) DEFAULT 0.00,
  `daily_tasks` int(5) DEFAULT 3,
  `per_order` decimal(10,4) DEFAULT 0.3000,
  `daily_earnings` decimal(10,4) DEFAULT 0.9000,
  `duration_days` int(5) DEFAULT 0,
  `is_free` tinyint(1) DEFAULT 0,
  `sort_order` int(5) DEFAULT 0,
  `color_from` varchar(20) DEFAULT '#3eaabb',
  `color_to` varchar(20) DEFAULT '#92c7dd',
  `badge_img` varchar(255) DEFAULT '',
  `active` tinyint(1) DEFAULT 1,
  `created_at` datetime DEFAULT current_timestamp(),
  `ref_commission_l1` decimal(5,2) DEFAULT 10.00 COMMENT 'Level 1 referral join commission %',
  `ref_commission_l2` decimal(5,2) DEFAULT 5.00 COMMENT 'Level 2 referral join commission %',
  `ref_commission_l3` decimal(5,2) DEFAULT 2.00 COMMENT 'Level 3 referral join commission %',
  `task_commission_l1` decimal(5,2) DEFAULT 5.00 COMMENT 'Level 1 task earnings commission %',
  `task_commission_l2` decimal(5,2) DEFAULT 3.00 COMMENT 'Level 2 task earnings commission %',
  `task_commission_l3` decimal(5,2) DEFAULT 1.00 COMMENT 'Level 3 task earnings commission %'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

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

INSERT INTO `plans` (`id`, `name`, `slug`, `price`, `daily_tasks`, `per_order`, `daily_earnings`, `duration_days`, `is_free`, `sort_order`, `color_from`, `color_to`, `badge_img`, `active`, `created_at`, `ref_commission_l1`, `ref_commission_l2`, `ref_commission_l3`, `task_commission_l1`, `task_commission_l2`, `task_commission_l3`) VALUES
(1, 'Internship', 'internship', 0.00, 3, 0.3000, 0.9000, 2, 1, 0, '#7f8fa6', '#a4b2c4', 'uploads/badges/badge_69d7b22cac595.png', 1, '2026-04-04 06:54:08', 10.00, 5.00, 2.00, 5.00, 3.00, 1.00),
(2, 'F1', 'f1', 30.00, 3, 0.3000, 0.9000, 0, 0, 1, '#3eaabb', '#92c7dd', 'uploads/badges/badge_69d7b26d2dcc8.png', 1, '2026-04-04 06:54:08', 10.00, 5.00, 2.00, 5.00, 3.00, 1.00),
(3, 'F2', 'f2', 50.00, 3, 0.4000, 1.2000, 0, 0, 2, '#3eaabb', '#5dade2', 'uploads/badges/badge_69d7b28c90cf7.png', 1, '2026-04-04 06:54:08', 10.00, 5.00, 2.00, 5.00, 3.00, 1.00),
(4, 'F3', 'f3', 80.00, 4, 0.5000, 2.0000, 0, 0, 3, '#3eaabb', '#5dade2', 'uploads/badges/badge_69d7b2ef1fd28.png', 1, '2026-04-04 06:54:08', 10.00, 5.00, 2.00, 5.00, 3.00, 1.00),
(5, 'F4', 'f4', 240.00, 5, 1.2000, 6.0000, 0, 0, 4, '#7f8aff', '#c87de8', 'uploads/badges/badge_69d7b2b83c3a6.png', 1, '2026-04-04 06:54:08', 10.00, 5.00, 2.00, 5.00, 3.00, 1.00),
(6, 'F5', 'f5', 800.00, 10, 2.2000, 22.0000, 0, 0, 5, '#9b59b6', '#c006bc', 'uploads/badges/badge_69d7b2c388f90.png', 1, '2026-04-04 06:54:08', 10.00, 5.00, 2.00, 5.00, 3.00, 1.00),
(7, 'F6', 'f6', 2000.00, 10, 5.8000, 58.0000, 0, 0, 6, '#8e44ad', '#e91e63', 'uploads/badges/badge_69d7b30a3db4c.png', 1, '2026-04-04 06:54:08', 10.00, 5.00, 2.00, 5.00, 3.00, 1.00),
(8, 'F7', 'f7', 4000.00, 15, 8.0000, 120.0000, 0, 0, 7, '#ef7e9a', '#8611a5', 'uploads/badges/badge_69d7b31743240.png', 1, '2026-04-04 06:54:08', 10.00, 5.00, 2.00, 5.00, 3.00, 1.00),
(9, 'F8', 'f8', 12000.00, 20, 18.0000, 360.0000, 0, 0, 8, '#e74c3c', '#8e44ad', 'uploads/badges/badge_69d7b3254506b.png', 1, '2026-04-04 06:54:08', 10.00, 5.00, 2.00, 5.00, 3.00, 1.00),
(10, 'F9', 'f9', 25000.00, 34, 25.0000, 850.0000, 0, 0, 9, '#3f273f', '#6c3483', 'uploads/badges/badge_69d7b33313510.png', 1, '2026-04-04 06:54:08', 10.00, 5.00, 2.00, 5.00, 3.00, 1.00);

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

--
-- Table structure for table `plan_videos`
--

CREATE TABLE `plan_videos` (
  `id` int(11) NOT NULL,
  `plan_id` int(11) NOT NULL,
  `title` varchar(255) NOT NULL,
  `cover_img` varchar(500) DEFAULT '',
  `video_url` varchar(500) DEFAULT '',
  `earn_amount` decimal(10,4) DEFAULT 0.0000,
  `active` tinyint(1) DEFAULT 1,
  `created_at` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

--
-- Dumping data for table `plan_videos`
--

INSERT INTO `plan_videos` (`id`, `plan_id`, `title`, `cover_img`, `video_url`, `earn_amount`, `active`, `created_at`) VALUES
(32, 1, 'zebran', 'uploads/covers/cover_69d71720b7142.jpg', 'uploads/videos/video_69d71720b733e.mp4', 0.0000, 1, '2026-04-08 23:04:00'),
(33, 2, 'zebran', 'uploads/covers/cover_69d71720b7142.jpg', 'uploads/videos/video_69d71720b733e.mp4', 0.0000, 1, '2026-04-08 23:04:00'),
(34, 3, 'zebran', 'uploads/covers/cover_69d71720b7142.jpg', 'uploads/videos/video_69d71720b733e.mp4', 0.0000, 1, '2026-04-08 23:04:00'),
(35, 4, 'zebran', 'uploads/covers/cover_69d71720b7142.jpg', 'uploads/videos/video_69d71720b733e.mp4', 0.0000, 1, '2026-04-08 23:04:00'),
(36, 5, 'zebran', 'uploads/covers/cover_69d71720b7142.jpg', 'uploads/videos/video_69d71720b733e.mp4', 0.0000, 1, '2026-04-08 23:04:00'),
(37, 6, 'zebran', 'uploads/covers/cover_69d71720b7142.jpg', 'uploads/videos/video_69d71720b733e.mp4', 0.0000, 1, '2026-04-08 23:04:00'),
(38, 7, 'zebran', 'uploads/covers/cover_69d71720b7142.jpg', 'uploads/videos/video_69d71720b733e.mp4', 0.0000, 1, '2026-04-08 23:04:00'),
(39, 8, 'zebran', 'uploads/covers/cover_69d71720b7142.jpg', 'uploads/videos/video_69d71720b733e.mp4', 0.0000, 1, '2026-04-08 23:04:00'),
(40, 9, 'zebran', 'uploads/covers/cover_69d71720b7142.jpg', 'uploads/videos/video_69d71720b733e.mp4', 0.0000, 1, '2026-04-08 23:04:00'),
(41, 10, 'zebran', 'uploads/covers/cover_69d71720b7142.jpg', 'uploads/videos/video_69d71720b733e.mp4', 0.0000, 1, '2026-04-08 23:04:00'),
(42, 1, 'play', 'uploads/covers/cover_69d717f281252.jpg', 'uploads/videos/video_69d717f281493.mp4', 0.0000, 1, '2026-04-08 23:07:30'),
(43, 2, 'play', 'uploads/covers/cover_69d717f281252.jpg', 'uploads/videos/video_69d717f281493.mp4', 0.0000, 1, '2026-04-08 23:07:30'),
(44, 3, 'play', 'uploads/covers/cover_69d717f281252.jpg', 'uploads/videos/video_69d717f281493.mp4', 0.0000, 1, '2026-04-08 23:07:30'),
(45, 4, 'play', 'uploads/covers/cover_69d717f281252.jpg', 'uploads/videos/video_69d717f281493.mp4', 0.0000, 1, '2026-04-08 23:07:30'),
(46, 5, 'play', 'uploads/covers/cover_69d717f281252.jpg', 'uploads/videos/video_69d717f281493.mp4', 0.0000, 1, '2026-04-08 23:07:30'),
(47, 6, 'play', 'uploads/covers/cover_69d717f281252.jpg', 'uploads/videos/video_69d717f281493.mp4', 0.0000, 1, '2026-04-08 23:07:30'),
(48, 7, 'play', 'uploads/covers/cover_69d717f281252.jpg', 'uploads/videos/video_69d717f281493.mp4', 0.0000, 1, '2026-04-08 23:07:30'),
(49, 8, 'play', 'uploads/covers/cover_69d717f281252.jpg', 'uploads/videos/video_69d717f281493.mp4', 0.0000, 1, '2026-04-08 23:07:30'),
(50, 9, 'play', 'uploads/covers/cover_69d717f281252.jpg', 'uploads/videos/video_69d717f281493.mp4', 0.0000, 1, '2026-04-08 23:07:30'),
(51, 10, 'play', 'uploads/covers/cover_69d717f281252.jpg', 'uploads/videos/video_69d717f281493.mp4', 0.0000, 1, '2026-04-08 23:07:30'),
(52, 1, 'shack', 'uploads/covers/cover_69d7186abe751.jpg', 'uploads/videos/video_69d7186abe927.mp4', 0.0000, 1, '2026-04-08 23:09:30'),
(53, 2, 'shack', 'uploads/covers/cover_69d7186abe751.jpg', 'uploads/videos/video_69d7186abe927.mp4', 0.0000, 1, '2026-04-08 23:09:30'),
(54, 3, 'shack', 'uploads/covers/cover_69d7186abe751.jpg', 'uploads/videos/video_69d7186abe927.mp4', 0.0000, 1, '2026-04-08 23:09:30'),
(55, 4, 'shack', 'uploads/covers/cover_69d7186abe751.jpg', 'uploads/videos/video_69d7186abe927.mp4', 0.0000, 1, '2026-04-08 23:09:30'),
(56, 5, 'shack', 'uploads/covers/cover_69d7186abe751.jpg', 'uploads/videos/video_69d7186abe927.mp4', 0.0000, 1, '2026-04-08 23:09:30'),
(57, 6, 'shack', 'uploads/covers/cover_69d7186abe751.jpg', 'uploads/videos/video_69d7186abe927.mp4', 0.0000, 1, '2026-04-08 23:09:30'),
(58, 7, 'shack', 'uploads/covers/cover_69d7186abe751.jpg', 'uploads/videos/video_69d7186abe927.mp4', 0.0000, 1, '2026-04-08 23:09:30'),
(59, 8, 'shack', 'uploads/covers/cover_69d7186abe751.jpg', 'uploads/videos/video_69d7186abe927.mp4', 0.0000, 1, '2026-04-08 23:09:30'),
(60, 9, 'shack', 'uploads/covers/cover_69d7186abe751.jpg', 'uploads/videos/video_69d7186abe927.mp4', 0.0000, 1, '2026-04-08 23:09:30'),
(61, 10, 'shack', 'uploads/covers/cover_69d7186abe751.jpg', 'uploads/videos/video_69d7186abe927.mp4', 0.0000, 1, '2026-04-08 23:09:30'),
(62, 1, 'the way you move', 'uploads/covers/cover_69d7195850f20.jpg', 'uploads/videos/video_69d719585117e.mp4', 0.0000, 1, '2026-04-08 23:13:28'),
(63, 2, 'the way you move', 'uploads/covers/cover_69d7195850f20.jpg', 'uploads/videos/video_69d719585117e.mp4', 0.0000, 1, '2026-04-08 23:13:28'),
(64, 3, 'the way you move', 'uploads/covers/cover_69d7195850f20.jpg', 'uploads/videos/video_69d719585117e.mp4', 0.0000, 1, '2026-04-08 23:13:28'),
(65, 4, 'the way you move', 'uploads/covers/cover_69d7195850f20.jpg', 'uploads/videos/video_69d719585117e.mp4', 0.0000, 1, '2026-04-08 23:13:28'),
(66, 5, 'the way you move', 'uploads/covers/cover_69d7195850f20.jpg', 'uploads/videos/video_69d719585117e.mp4', 0.0000, 1, '2026-04-08 23:13:28'),
(67, 6, 'the way you move', 'uploads/covers/cover_69d7195850f20.jpg', 'uploads/videos/video_69d719585117e.mp4', 0.0000, 1, '2026-04-08 23:13:28'),
(68, 7, 'the way you move', 'uploads/covers/cover_69d7195850f20.jpg', 'uploads/videos/video_69d719585117e.mp4', 0.0000, 1, '2026-04-08 23:13:28'),
(69, 8, 'the way you move', 'uploads/covers/cover_69d7195850f20.jpg', 'uploads/videos/video_69d719585117e.mp4', 0.0000, 1, '2026-04-08 23:13:28'),
(70, 9, 'the way you move', 'uploads/covers/cover_69d7195850f20.jpg', 'uploads/videos/video_69d719585117e.mp4', 0.0000, 1, '2026-04-08 23:13:28'),
(71, 10, 'the way you move', 'uploads/covers/cover_69d7195850f20.jpg', 'uploads/videos/video_69d719585117e.mp4', 0.0000, 1, '2026-04-08 23:13:28'),
(72, 1, 'fly', 'uploads/covers/cover_69d71b0a532cb.jpg', 'uploads/videos/video_69d71b0a534d4.mp4', 0.0000, 1, '2026-04-08 23:20:42'),
(73, 2, 'fly', 'uploads/covers/cover_69d71b0a532cb.jpg', 'uploads/videos/video_69d71b0a534d4.mp4', 0.0000, 1, '2026-04-08 23:20:42'),
(74, 3, 'fly', 'uploads/covers/cover_69d71b0a532cb.jpg', 'uploads/videos/video_69d71b0a534d4.mp4', 0.0000, 1, '2026-04-08 23:20:42'),
(75, 4, 'fly', 'uploads/covers/cover_69d71b0a532cb.jpg', 'uploads/videos/video_69d71b0a534d4.mp4', 0.0000, 1, '2026-04-08 23:20:42'),
(76, 5, 'fly', 'uploads/covers/cover_69d71b0a532cb.jpg', 'uploads/videos/video_69d71b0a534d4.mp4', 0.0000, 1, '2026-04-08 23:20:42'),
(77, 6, 'fly', 'uploads/covers/cover_69d71b0a532cb.jpg', 'uploads/videos/video_69d71b0a534d4.mp4', 0.0000, 1, '2026-04-08 23:20:42'),
(78, 7, 'fly', 'uploads/covers/cover_69d71b0a532cb.jpg', 'uploads/videos/video_69d71b0a534d4.mp4', 0.0000, 1, '2026-04-08 23:20:42'),
(79, 8, 'fly', 'uploads/covers/cover_69d71b0a532cb.jpg', 'uploads/videos/video_69d71b0a534d4.mp4', 0.0000, 1, '2026-04-08 23:20:42'),
(80, 9, 'fly', 'uploads/covers/cover_69d71b0a532cb.jpg', 'uploads/videos/video_69d71b0a534d4.mp4', 0.0000, 1, '2026-04-08 23:20:42'),
(81, 10, 'fly', 'uploads/covers/cover_69d71b0a532cb.jpg', 'uploads/videos/video_69d71b0a534d4.mp4', 0.0000, 1, '2026-04-08 23:20:42'),
(82, 1, 'kids fighting', 'uploads/covers/cover_69d71c1d83491.jpg', 'uploads/videos/video_69d71c1d8368d.mp4', 0.0000, 1, '2026-04-08 23:25:17'),
(83, 2, 'kids fighting', 'uploads/covers/cover_69d71c1d83491.jpg', 'uploads/videos/video_69d71c1d8368d.mp4', 0.0000, 1, '2026-04-08 23:25:17'),
(84, 3, 'kids fighting', 'uploads/covers/cover_69d71c1d83491.jpg', 'uploads/videos/video_69d71c1d8368d.mp4', 0.0000, 1, '2026-04-08 23:25:17'),
(85, 4, 'kids fighting', 'uploads/covers/cover_69d71c1d83491.jpg', 'uploads/videos/video_69d71c1d8368d.mp4', 0.0000, 1, '2026-04-08 23:25:17'),
(86, 5, 'kids fighting', 'uploads/covers/cover_69d71c1d83491.jpg', 'uploads/videos/video_69d71c1d8368d.mp4', 0.0000, 1, '2026-04-08 23:25:17'),
(87, 6, 'kids fighting', 'uploads/covers/cover_69d71c1d83491.jpg', 'uploads/videos/video_69d71c1d8368d.mp4', 0.0000, 1, '2026-04-08 23:25:17'),
(88, 7, 'kids fighting', 'uploads/covers/cover_69d71c1d83491.jpg', 'uploads/videos/video_69d71c1d8368d.mp4', 0.0000, 1, '2026-04-08 23:25:17'),
(89, 8, 'kids fighting', 'uploads/covers/cover_69d71c1d83491.jpg', 'uploads/videos/video_69d71c1d8368d.mp4', 0.0000, 1, '2026-04-08 23:25:17'),
(90, 9, 'kids fighting', 'uploads/covers/cover_69d71c1d83491.jpg', 'uploads/videos/video_69d71c1d8368d.mp4', 0.0000, 1, '2026-04-08 23:25:17'),
(91, 10, 'kids fighting', 'uploads/covers/cover_69d71c1d83491.jpg', 'uploads/videos/video_69d71c1d8368d.mp4', 0.0000, 1, '2026-04-08 23:25:17'),
(92, 1, 'Skale', 'uploads/covers/cover_69d79f6d3549e.jpg', 'uploads/videos/video_69d79f6d35829.mp4', 0.0000, 1, '2026-04-09 08:45:33'),
(93, 2, 'Skale', 'uploads/covers/cover_69d79f6d3549e.jpg', 'uploads/videos/video_69d79f6d35829.mp4', 0.0000, 1, '2026-04-09 08:45:33'),
(94, 3, 'Skale', 'uploads/covers/cover_69d79f6d3549e.jpg', 'uploads/videos/video_69d79f6d35829.mp4', 0.0000, 1, '2026-04-09 08:45:33'),
(95, 4, 'Skale', 'uploads/covers/cover_69d79f6d3549e.jpg', 'uploads/videos/video_69d79f6d35829.mp4', 0.0000, 1, '2026-04-09 08:45:33'),
(96, 5, 'Skale', 'uploads/covers/cover_69d79f6d3549e.jpg', 'uploads/videos/video_69d79f6d35829.mp4', 0.0000, 1, '2026-04-09 08:45:33'),
(97, 6, 'Skale', 'uploads/covers/cover_69d79f6d3549e.jpg', 'uploads/videos/video_69d79f6d35829.mp4', 0.0000, 1, '2026-04-09 08:45:33'),
(98, 7, 'Skale', 'uploads/covers/cover_69d79f6d3549e.jpg', 'uploads/videos/video_69d79f6d35829.mp4', 0.0000, 1, '2026-04-09 08:45:33'),
(99, 8, 'Skale', 'uploads/covers/cover_69d79f6d3549e.jpg', 'uploads/videos/video_69d79f6d35829.mp4', 0.0000, 1, '2026-04-09 08:45:33'),
(100, 9, 'Skale', 'uploads/covers/cover_69d79f6d3549e.jpg', 'uploads/videos/video_69d79f6d35829.mp4', 0.0000, 1, '2026-04-09 08:45:33'),
(101, 10, 'Skale', 'uploads/covers/cover_69d79f6d3549e.jpg', 'uploads/videos/video_69d79f6d35829.mp4', 0.0000, 1, '2026-04-09 08:45:33');

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

--
-- Table structure for table `profits`
--

CREATE TABLE `profits` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `amount` decimal(12,2) NOT NULL DEFAULT 0.00,
  `source` varchar(50) DEFAULT 'investment',
  `created_at` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

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

--
-- Table structure for table `settings`
--

CREATE TABLE `settings` (
  `id` int(11) NOT NULL,
  `key_name` varchar(100) NOT NULL,
  `key_value` text DEFAULT NULL,
  `updated_at` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

--
-- Dumping data for table `settings`
--

INSERT INTO `settings` (`id`, `key_name`, `key_value`, `updated_at`) VALUES
(1, 'support_url', 'https://wa.me/255700000000', '2026-04-04 05:33:47'),
(2, 'support_url_admin', 'https://wa.me/255700000000', '2026-04-04 05:33:47'),
(3, 'currency_symbol', 'TZS', '2026-04-04 08:08:46'),
(6, 'min_deposit', '1000', '2026-04-05 11:45:58'),
(7, 'max_deposit', '10000000', '2026-04-05 11:45:58'),
(8, 'min_withdraw', '500', '2026-04-05 11:45:58'),
(9, 'max_withdraw', '5000000', '2026-04-05 11:45:58'),
(10, 'withdraw_fee_pct', '2', '2026-04-05 11:45:58');

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

--
-- Table structure for table `support_messages`
--

CREATE TABLE `support_messages` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `sender` enum('user','admin') NOT NULL,
  `message` text NOT NULL,
  `is_read` tinyint(1) DEFAULT 0,
  `created_at` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `support_messages`
--

INSERT INTO `support_messages` (`id`, `user_id`, `sender`, `message`, `is_read`, `created_at`) VALUES
(1, 1, 'user', 'test message', 1, '2026-04-05 10:45:15');

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

--
-- Table structure for table `task_completions`
--

CREATE TABLE `task_completions` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `video_id` int(11) NOT NULL,
  `plan_id` int(11) NOT NULL,
  `earned` decimal(10,4) DEFAULT 0.0000,
  `completed_at` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

--
-- Dumping data for table `task_completions`
--

INSERT INTO `task_completions` (`id`, `user_id`, `video_id`, `plan_id`, `earned`, `completed_at`) VALUES
(1, 1, 51, 10, 25.0000, '2026-04-09 01:57:37'),
(2, 1, 61, 10, 25.0000, '2026-04-09 01:58:28'),
(3, 1, 41, 10, 25.0000, '2026-04-09 02:21:59'),
(4, 1, 71, 10, 25.0000, '2026-04-09 02:22:17'),
(5, 1, 81, 10, 25.0000, '2026-04-09 02:22:48'),
(6, 1, 91, 10, 25.0000, '2026-04-09 02:23:06'),
(7, 1, 71, 10, 25.0000, '2026-04-09 03:11:39'),
(8, 1, 81, 10, 25.0000, '2026-04-09 03:14:28'),
(9, 1, 51, 10, 25.0000, '2026-04-09 03:27:09'),
(10, 1, 91, 10, 25.0000, '2026-04-09 03:32:33'),
(11, 1, 51, 10, 25.0000, '2026-04-09 03:33:20'),
(12, 1, 71, 10, 25.0000, '2026-04-09 08:04:56'),
(13, 1, 51, 10, 25.0000, '2026-04-09 08:05:07'),
(14, 1, 61, 10, 25.0000, '2026-04-09 08:05:21'),
(15, 1, 101, 10, 25.0000, '2026-04-09 08:49:41'),
(16, 1, 101, 10, 25.0000, '2026-04-09 11:57:46'),
(17, 1, 81, 10, 25.0000, '2026-04-09 11:57:58'),
(18, 1, 91, 10, 25.0000, '2026-04-09 11:58:08'),
(19, 8, 92, 1, 0.3000, '2026-04-09 15:45:12'),
(20, 8, 32, 1, 0.3000, '2026-04-09 15:45:36'),
(21, 8, 72, 1, 0.3000, '2026-04-09 15:45:50'),
(22, 9, 32, 1, 0.3000, '2026-04-10 00:11:35'),
(23, 10, 92, 1, 0.3000, '2026-04-10 00:21:48'),
(24, 10, 42, 1, 0.3000, '2026-04-10 00:22:10'),
(25, 10, 49, 8, 8.0000, '2026-04-10 00:30:21'),
(26, 10, 49, 8, 8.0000, '2026-04-10 01:06:48');

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

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `phone` varchar(20) NOT NULL,
  `password` varchar(255) NOT NULL,
  `invitation_code` varchar(50) DEFAULT NULL,
  `created_at` datetime DEFAULT current_timestamp(),
  `referral_code` varchar(20) DEFAULT NULL,
  `referred_by` int(11) DEFAULT NULL,
  `balance` decimal(12,4) DEFAULT 0.0000,
  `security_deposit` decimal(12,4) DEFAULT 0.0000,
  `total_earned` decimal(12,4) DEFAULT 0.0000,
  `credits` int(11) DEFAULT 100,
  `full_name` varchar(100) DEFAULT NULL,
  `avatar` varchar(255) DEFAULT NULL,
  `usdt_wallet` varchar(255) DEFAULT NULL,
  `fund_password` varchar(255) DEFAULT NULL,
  `phone_number` varchar(20) GENERATED ALWAYS AS (`phone`) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

--
-- Dumping data for table `users`
--

INSERT INTO `users` (`id`, `phone`, `password`, `invitation_code`, `created_at`, `referral_code`, `referred_by`, `balance`, `security_deposit`, `total_earned`, `credits`, `full_name`, `avatar`, `usdt_wallet`, `fund_password`) VALUES
(9, '0769208136', '$2y$10$OWX0O/gVb.rPWNzM7TFHJO158I0rA5DsOwDN1JO9ASE/UIg0V/kUq', '', '2026-04-09 23:47:25', 'WFM00009', NULL, 200.7000, 5000.0000, 200.4000, 100, NULL, NULL, NULL, NULL),
(10, '07123456789', '$2y$10$fMw8FuX1pdQCcnnBz4/XRuGhab6GfX0n0ILohWFRteVs6wQDyc5fm', 'WFM00009', '2026-04-10 00:08:01', NULL, 9, 16.6000, 4000.0000, 8.0000, 100, NULL, NULL, NULL, NULL);

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

--
-- Table structure for table `user_plans`
--

CREATE TABLE `user_plans` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `plan_id` int(11) NOT NULL,
  `joined_at` datetime DEFAULT current_timestamp(),
  `expires_at` datetime DEFAULT NULL,
  `active` tinyint(1) DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

--
-- Dumping data for table `user_plans`
--

INSERT INTO `user_plans` (`id`, `user_id`, `plan_id`, `joined_at`, `expires_at`, `active`) VALUES
(1, 1, 1, '2026-04-04 06:59:05', '2026-04-06 10:59:05', 1),
(2, 1, 2, '2026-04-04 08:41:22', NULL, 1),
(3, 1, 3, '2026-04-04 12:13:40', NULL, 1),
(4, 1, 4, '2026-04-05 15:21:15', NULL, 1),
(5, 6, 1, '2026-04-06 13:04:35', '2026-04-08 17:04:35', 1),
(6, 7, 1, '2026-04-06 13:15:57', '2026-04-08 17:15:57', 1),
(7, 1, 10, '2026-04-08 23:58:33', NULL, 1),
(8, 8, 1, '2026-04-09 15:41:54', '2026-04-11 19:41:54', 1),
(9, 9, 1, '2026-04-09 23:47:41', '2026-04-12 03:47:41', 1),
(10, 10, 1, '2026-04-10 00:10:26', '2026-04-12 04:10:26', 0),
(11, 10, 8, '2026-04-10 00:29:33', NULL, 0),
(12, 10, 7, '2026-04-10 01:09:31', NULL, 1);

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

--
-- Table structure for table `withdrawals`
--

CREATE TABLE `withdrawals` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `amount` decimal(12,4) NOT NULL,
  `fee` decimal(12,4) NOT NULL DEFAULT 0.0000 COMMENT 'Withdrawal fee deducted',
  `net_amount` decimal(12,4) NOT NULL COMMENT 'amount - fee',
  `method` varchar(80) NOT NULL COMMENT 'e.g. M-Pesa, USDT, Bank',
  `account_ref` varchar(255) NOT NULL COMMENT 'Phone / wallet / account where to send',
  `account_name` varchar(150) DEFAULT NULL,
  `fund_password_ok` tinyint(1) DEFAULT 0 COMMENT '1 = fund password was verified',
  `status` enum('pending','approved','rejected') NOT NULL DEFAULT 'pending',
  `admin_note` varchar(255) DEFAULT NULL,
  `created_at` datetime DEFAULT current_timestamp(),
  `updated_at` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `withdrawals`
--

INSERT INTO `withdrawals` (`id`, `user_id`, `amount`, `fee`, `net_amount`, `method`, `account_ref`, `account_name`, `fund_password_ok`, `status`, `admin_note`, `created_at`, `updated_at`) VALUES
(1, 1, 1000.0000, 20.0000, 980.0000, 'M-Pesa', '09876542312', 'VFO MNH', 0, 'rejected', '', '2026-04-06 09:16:58', '2026-04-06 09:28:25'),
(2, 1, 1000.0000, 20.0000, 980.0000, 'M-Pesa', '09876542312', 'VFO MNH', 0, 'rejected', '', '2026-04-06 09:17:12', '2026-04-06 09:28:32'),
(3, 1, 1000.0000, 20.0000, 980.0000, 'M-Pesa', '09876542312', 'VFO MNH', 0, 'approved', NULL, '2026-04-06 09:27:51', '2026-04-06 09:28:56');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `account_logs`
--
ALTER TABLE `account_logs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_user_type` (`user_id`,`type`),
  ADD KEY `idx_created` (`created_at`);

--
-- Indexes for table `admin_users`
--
ALTER TABLE `admin_users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `username` (`username`);

--
-- Indexes for table `commission_logs`
--
ALTER TABLE `commission_logs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_user` (`user_id`),
  ADD KEY `idx_from` (`from_user_id`);

--
-- Indexes for table `daily_profit_credits`
--
ALTER TABLE `daily_profit_credits`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_user` (`user_id`),
  ADD KEY `idx_investment` (`investment_id`);

--
-- Indexes for table `deposits`
--
ALTER TABLE `deposits`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_dep_user` (`user_id`),
  ADD KEY `idx_dep_status` (`status`);

--
-- Indexes for table `investments`
--
ALTER TABLE `investments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_inv_user` (`user_id`),
  ADD KEY `idx_inv_plan` (`plan_id`),
  ADD KEY `idx_inv_status` (`status`);

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

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

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

--
-- Indexes for table `plan_videos`
--
ALTER TABLE `plan_videos`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_video_plan` (`plan_id`);

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

--
-- Indexes for table `settings`
--
ALTER TABLE `settings`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `key_name` (`key_name`);

--
-- Indexes for table `support_messages`
--
ALTER TABLE `support_messages`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_user_id` (`user_id`),
  ADD KEY `idx_created` (`created_at`);

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

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `phone` (`phone`),
  ADD UNIQUE KEY `referral_code` (`referral_code`);

--
-- Indexes for table `user_plans`
--
ALTER TABLE `user_plans`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_up_user` (`user_id`),
  ADD KEY `fk_up_plan` (`plan_id`);

--
-- Indexes for table `withdrawals`
--
ALTER TABLE `withdrawals`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_wd_user` (`user_id`),
  ADD KEY `idx_wd_status` (`status`);

--
-- AUTO_INCREMENT for dumped tables
--

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/*!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 */;
