-- Database Structure Export (No Data) -- Database: barnsoci_datingz1 -- Date: 2026-01-13 17:03:46 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; 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 */; -- -------------------------------------------------------- -- Table structure for table `achievements` -- -------------------------------------------------------- DROP TABLE IF EXISTS `achievements`; CREATE TABLE `achievements` ( `id` int(11) NOT NULL, `title` varchar(100) NOT NULL, `harvest` int(11) DEFAULT 0, `sales` int(11) DEFAULT 0, `level` int(11) DEFAULT 0, `xp` int(11) DEFAULT 0, `item_id` int(11) DEFAULT NULL, `years` int(11) NOT NULL DEFAULT 0, `image` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `admin_activity_logs` -- -------------------------------------------------------- DROP TABLE IF EXISTS `admin_activity_logs`; CREATE TABLE `admin_activity_logs` ( `id` int(11) NOT NULL AUTO_INCREMENT, `admin_id` int(11) NOT NULL, `admin_username` varchar(100) DEFAULT NULL, `action` varchar(50) NOT NULL, `target_user_id` int(11) DEFAULT NULL, `target_username` varchar(100) DEFAULT NULL, `old_value` varchar(255) DEFAULT NULL, `new_value` varchar(255) DEFAULT NULL, `reason` text DEFAULT NULL, `ip_address` varchar(45) DEFAULT NULL, `user_agent` varchar(255) DEFAULT NULL, `created_at` datetime NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), KEY `idx_admin_id` (`admin_id`), KEY `idx_action` (`action`), KEY `idx_target_user_id` (`target_user_id`), KEY `idx_created_at` (`created_at`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `admin_grades` -- -------------------------------------------------------- DROP TABLE IF EXISTS `admin_grades`; CREATE TABLE `admin_grades` ( `id` int(11) NOT NULL AUTO_INCREMENT, `grade_id` varchar(50) NOT NULL, `grade_name` varchar(100) NOT NULL, `description` text DEFAULT NULL, `permissions` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`permissions`)), `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`id`), UNIQUE KEY `grade_id` (`grade_id`) ) ENGINE=InnoDB AUTO_INCREMENT=7987 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `app_store_info` -- -------------------------------------------------------- DROP TABLE IF EXISTS `app_store_info`; CREATE TABLE `app_store_info` ( `id` int(11) NOT NULL AUTO_INCREMENT, `app_name` varchar(255) NOT NULL DEFAULT 'Farm Game', `app_description` text DEFAULT NULL, `app_version` varchar(50) DEFAULT '1.0.0', `cover_image` varchar(255) DEFAULT NULL, `apk_file` varchar(255) DEFAULT NULL, `screenshots` text DEFAULT NULL, `package_name` varchar(255) DEFAULT NULL, `min_android_version` varchar(20) DEFAULT NULL, `file_size` bigint(20) DEFAULT NULL, `download_count` int(11) DEFAULT 0, `is_active` tinyint(1) DEFAULT 1, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- Table structure for table `bank_deposits` -- -------------------------------------------------------- DROP TABLE IF EXISTS `bank_deposits`; CREATE TABLE `bank_deposits` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `amount` int(11) NOT NULL, `interest` int(11) NOT NULL, `hours` int(11) NOT NULL, `start_time` datetime NOT NULL, `end_time` datetime NOT NULL, `claimed` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `user_id` (`user_id`) ) ENGINE=InnoDB AUTO_INCREMENT=124 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `bank_loan_payments` -- -------------------------------------------------------- DROP TABLE IF EXISTS `bank_loan_payments`; CREATE TABLE `bank_loan_payments` ( `id` int(11) NOT NULL AUTO_INCREMENT, `loan_id` int(11) NOT NULL, `item_id` int(11) NOT NULL, `item_name` varchar(100) NOT NULL, `quantity` int(11) NOT NULL, `sale_total` int(11) NOT NULL, `applied` int(11) NOT NULL, `created_at` datetime NOT NULL, PRIMARY KEY (`id`), KEY `loan_id` (`loan_id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `bank_loans` -- -------------------------------------------------------- DROP TABLE IF EXISTS `bank_loans`; CREATE TABLE `bank_loans` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `amount` int(11) NOT NULL, `amount_due` int(11) NOT NULL, `amount_repaid` int(11) NOT NULL DEFAULT 0, `start_time` datetime NOT NULL, `repaid_time` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `user_id` (`user_id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `bee_levels` -- -------------------------------------------------------- DROP TABLE IF EXISTS `bee_levels`; CREATE TABLE `bee_levels` ( `id` int(11) NOT NULL AUTO_INCREMENT, `level_name` varchar(100) NOT NULL, `level_number` int(11) NOT NULL, `bee_spawn_time` int(11) DEFAULT 1000, `max_bees` int(11) DEFAULT 10, `level_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`level_data`)), `created_by` int(11) DEFAULT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`id`), UNIQUE KEY `level_number` (`level_number`), KEY `created_by` (`created_by`), KEY `idx_bee_levels_number` (`level_number`), CONSTRAINT `bee_levels_ibfk_1` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `bee_scores` -- -------------------------------------------------------- DROP TABLE IF EXISTS `bee_scores`; CREATE TABLE `bee_scores` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `level_id` int(11) NOT NULL, `score` int(11) NOT NULL DEFAULT 0, `time_played` int(11) DEFAULT 0, `played_at` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), UNIQUE KEY `unique_user_level` (`user_id`,`level_id`), KEY `idx_bee_scores_user` (`user_id`), KEY `idx_bee_scores_level` (`level_id`), KEY `idx_bee_scores_score` (`score`), CONSTRAINT `bee_scores_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE, CONSTRAINT `bee_scores_ibfk_2` FOREIGN KEY (`level_id`) REFERENCES `bee_levels` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `bs_auth_tokens` -- -------------------------------------------------------- DROP TABLE IF EXISTS `bs_auth_tokens`; CREATE TABLE `bs_auth_tokens` ( `token` char(40) NOT NULL, `steamid` varchar(32) DEFAULT NULL, `ip` varchar(45) DEFAULT NULL, `action` enum('login','register') NOT NULL, `status` enum('pending','ok','fail') NOT NULL DEFAULT 'pending', `username` varchar(32) DEFAULT NULL, `remember` tinyint(1) DEFAULT 0, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `expires_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`token`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci; -- -------------------------------------------------------- -- Table structure for table `bs_auth_users` -- -------------------------------------------------------- DROP TABLE IF EXISTS `bs_auth_users`; CREATE TABLE `bs_auth_users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `steamid` varchar(32) DEFAULT NULL, `ip` varchar(45) DEFAULT NULL, `username` varchar(32) NOT NULL, `pass_hash` varchar(255) NOT NULL, `remember` tinyint(1) NOT NULL DEFAULT 0, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `last_login` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `username` (`username`), KEY `idx_sid` (`steamid`), KEY `idx_ip` (`ip`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci; -- -------------------------------------------------------- -- Table structure for table `calendar_stamps` -- -------------------------------------------------------- DROP TABLE IF EXISTS `calendar_stamps`; CREATE TABLE `calendar_stamps` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `stamp_date` date NOT NULL, `reward_amount` decimal(10,2) DEFAULT 0.00, `created_at` datetime DEFAULT current_timestamp(), PRIMARY KEY (`id`), UNIQUE KEY `unique_user_date` (`user_id`,`stamp_date`), KEY `idx_user_id` (`user_id`), KEY `idx_stamp_date` (`stamp_date`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `counter_strike_admins` -- -------------------------------------------------------- DROP TABLE IF EXISTS `counter_strike_admins`; CREATE TABLE `counter_strike_admins` ( `id` int(11) NOT NULL AUTO_INCREMENT, `email` varchar(255) NOT NULL, `password_hash` varchar(255) NOT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `last_login` timestamp NULL DEFAULT NULL, `active` tinyint(1) NOT NULL DEFAULT 1, PRIMARY KEY (`id`), UNIQUE KEY `email` (`email`), KEY `idx_active` (`active`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `counter_strike_plugin_orders` -- -------------------------------------------------------- DROP TABLE IF EXISTS `counter_strike_plugin_orders`; CREATE TABLE `counter_strike_plugin_orders` ( `id` int(11) NOT NULL AUTO_INCREMENT, `plugin_id` int(11) NOT NULL, `buyer_email` varchar(255) NOT NULL, `payer_email` varchar(255) DEFAULT NULL, `paypal_txn_id` varchar(255) DEFAULT NULL, `paypal_status` varchar(50) DEFAULT 'PENDING', `amount` decimal(10,2) NOT NULL, `currency` varchar(10) DEFAULT 'USD', `access_token` char(64) NOT NULL, `paypal_payload` mediumtext DEFAULT NULL, `download_count` int(11) DEFAULT 0, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `completed_at` timestamp NULL DEFAULT NULL, `plan` varchar(32) DEFAULT 'basic', `plan_title` varchar(100) DEFAULT '', `download_url_snapshot` varchar(600) DEFAULT NULL, `plugin_name_snapshot` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `uniq_token` (`access_token`), KEY `idx_plugin` (`plugin_id`), KEY `idx_txn` (`paypal_txn_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- Table structure for table `counter_strike_plugin_presentations` -- -------------------------------------------------------- DROP TABLE IF EXISTS `counter_strike_plugin_presentations`; CREATE TABLE `counter_strike_plugin_presentations` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `image_url` varchar(500) DEFAULT NULL, `description` text DEFAULT NULL, `installation_tutorial` text DEFAULT NULL, `video_url` varchar(500) DEFAULT NULL, `gallery_images` text DEFAULT NULL, `download_url` varchar(500) DEFAULT NULL, `price` decimal(10,2) DEFAULT 0.00, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `active` tinyint(1) DEFAULT 1, `price_basic` decimal(10,2) DEFAULT 0.00, `price_premium` decimal(10,2) DEFAULT 0.00, `download_url_basic` varchar(500) DEFAULT NULL, `download_url_premium` varchar(500) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- Table structure for table `counter_strike_plugins` -- -------------------------------------------------------- DROP TABLE IF EXISTS `counter_strike_plugins`; CREATE TABLE `counter_strike_plugins` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `image_url` varchar(500) DEFAULT NULL, `description` text DEFAULT NULL, `installation_tutorial` text DEFAULT NULL, `video_url` varchar(500) DEFAULT NULL, `gallery_images` text DEFAULT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `active` tinyint(1) DEFAULT 1, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci; -- -------------------------------------------------------- -- Table structure for table `counter_strike_settings` -- -------------------------------------------------------- DROP TABLE IF EXISTS `counter_strike_settings`; CREATE TABLE `counter_strike_settings` ( `setting_key` varchar(100) NOT NULL, `setting_value` text DEFAULT NULL, `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`setting_key`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci; -- -------------------------------------------------------- -- Table structure for table `counter_strike_skins` -- -------------------------------------------------------- DROP TABLE IF EXISTS `counter_strike_skins`; CREATE TABLE `counter_strike_skins` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(100) NOT NULL, `image_url` varchar(255) NOT NULL, `price` decimal(10,2) NOT NULL DEFAULT 0.00, `description` text DEFAULT NULL, `active` tinyint(1) NOT NULL DEFAULT 1, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), KEY `idx_active` (`active`) ) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `counter_strike_tokens` -- -------------------------------------------------------- DROP TABLE IF EXISTS `counter_strike_tokens`; CREATE TABLE `counter_strike_tokens` ( `token` char(40) NOT NULL, `steamid` varchar(32) DEFAULT NULL, `ip` varchar(45) DEFAULT NULL, `action` enum('login','register','open') NOT NULL DEFAULT 'open', `status` enum('PENDING','OK','FAIL','pending','ok','fail') NOT NULL DEFAULT 'PENDING', `username` varchar(32) DEFAULT NULL, `remember` tinyint(1) DEFAULT 0, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp(), `expires_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`token`), KEY `idx_token_status` (`status`), KEY `idx_token_steamid` (`steamid`), KEY `idx_token_ip` (`ip`), KEY `idx_token_expires` (`expires_at`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `counter_strike_user_skins` -- -------------------------------------------------------- DROP TABLE IF EXISTS `counter_strike_user_skins`; CREATE TABLE `counter_strike_user_skins` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `skin_name` varchar(100) NOT NULL, `purchased_at` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), KEY `idx_user_id` (`user_id`), KEY `idx_skin_name` (`skin_name`) ) ENGINE=InnoDB AUTO_INCREMENT=83 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `counter_strike_users` -- -------------------------------------------------------- DROP TABLE IF EXISTS `counter_strike_users`; CREATE TABLE `counter_strike_users` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `username` varchar(32) NOT NULL, `passhash` varchar(255) NOT NULL, `email` varchar(255) DEFAULT NULL, `steamid` varchar(64) DEFAULT NULL, `ip` varchar(45) DEFAULT NULL, `auto_login` tinyint(1) NOT NULL DEFAULT 0, `last_login` timestamp NULL DEFAULT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `money` decimal(10,2) NOT NULL DEFAULT 0.00, PRIMARY KEY (`id`), UNIQUE KEY `username` (`username`), KEY `idx_steamid` (`steamid`), KEY `idx_ip` (`ip`), KEY `idx_auto_login` (`auto_login`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `counter_strike_users_util` -- -------------------------------------------------------- DROP TABLE IF EXISTS `counter_strike_users_util`; CREATE TABLE `counter_strike_users_util` ( `id` int(11) NOT NULL AUTO_INCREMENT, `steamid` varchar(32) DEFAULT NULL, `ip` varchar(45) DEFAULT NULL, `username` varchar(32) NOT NULL, `passhash` varchar(255) NOT NULL, `remember` tinyint(1) NOT NULL DEFAULT 0, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `last_login` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `username` (`username`), KEY `idx_sid` (`steamid`), KEY `idx_ip` (`ip`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `dbd_screenshots` -- -------------------------------------------------------- DROP TABLE IF EXISTS `dbd_screenshots`; CREATE TABLE `dbd_screenshots` ( `id` int(11) NOT NULL AUTO_INCREMENT, `filename` varchar(255) NOT NULL, `imgbb_url` text NOT NULL, `imgbb_display_url` text NOT NULL, `imgbb_delete_url` text DEFAULT NULL, `file_size` int(11) DEFAULT NULL, `file_created_date` datetime DEFAULT NULL, `upload_date` timestamp NOT NULL DEFAULT current_timestamp(), `hidden` tinyint(4) DEFAULT 0, `processed` tinyint(1) DEFAULT 1, PRIMARY KEY (`id`), UNIQUE KEY `unique_filename` (`filename`), KEY `idx_upload_date` (`upload_date`), KEY `idx_file_created_date` (`file_created_date`), KEY `idx_hidden` (`hidden`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- Table structure for table `dbd_users` -- -------------------------------------------------------- DROP TABLE IF EXISTS `dbd_users`; CREATE TABLE `dbd_users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(50) NOT NULL, `password` varchar(255) NOT NULL, `email` varchar(100) DEFAULT NULL, `full_name` varchar(100) DEFAULT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `last_login` timestamp NULL DEFAULT NULL, `is_active` tinyint(1) DEFAULT 1, PRIMARY KEY (`id`), UNIQUE KEY `username` (`username`), KEY `idx_username` (`username`), KEY `idx_is_active` (`is_active`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- Table structure for table `default_slots` -- -------------------------------------------------------- DROP TABLE IF EXISTS `default_slots`; CREATE TABLE `default_slots` ( `slot_number` int(11) NOT NULL, `slot_type` varchar(20) NOT NULL DEFAULT 'crop', `unlocked` tinyint(1) NOT NULL DEFAULT 0, `required_level` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`slot_number`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `farm_items` -- -------------------------------------------------------- DROP TABLE IF EXISTS `farm_items`; CREATE TABLE `farm_items` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(100) NOT NULL, `item_type` enum('plant','animal') NOT NULL, `slot_type` varchar(50) NOT NULL, `image_plant` varchar(255) NOT NULL, `image_ready` varchar(255) NOT NULL, `image_product` varchar(255) NOT NULL, `water_interval` int(11) NOT NULL DEFAULT 0, `feed_interval` int(11) NOT NULL DEFAULT 0, `water_times` int(11) NOT NULL DEFAULT 0, `feed_times` int(11) NOT NULL DEFAULT 0, `price` int(11) NOT NULL DEFAULT 0, `sell_price` int(11) NOT NULL DEFAULT 0, `production` int(11) NOT NULL DEFAULT 0, `active` tinyint(1) NOT NULL DEFAULT 1, `barn_capacity` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `friend_requests` -- -------------------------------------------------------- DROP TABLE IF EXISTS `friend_requests`; CREATE TABLE `friend_requests` ( `id` int(11) NOT NULL AUTO_INCREMENT, `sender_id` int(11) NOT NULL, `receiver_id` int(11) NOT NULL, `status` enum('pending','accepted','declined') NOT NULL DEFAULT 'pending', `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `responded_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `unique_pair` (`sender_id`,`receiver_id`), KEY `receiver_idx` (`receiver_id`), CONSTRAINT `fr_receiver_fk` FOREIGN KEY (`receiver_id`) REFERENCES `users` (`id`) ON DELETE CASCADE, CONSTRAINT `fr_sender_fk` FOREIGN KEY (`sender_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `helpers` -- -------------------------------------------------------- DROP TABLE IF EXISTS `helpers`; CREATE TABLE `helpers` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(50) NOT NULL, `image` varchar(255) NOT NULL, `message_file` varchar(255) NOT NULL, `waters` int(11) NOT NULL DEFAULT 0, `feeds` int(11) NOT NULL DEFAULT 0, `harvests` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `live_chat_messages` -- -------------------------------------------------------- DROP TABLE IF EXISTS `live_chat_messages`; CREATE TABLE `live_chat_messages` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `message` text NOT NULL, `created_at` datetime DEFAULT current_timestamp(), `is_read` tinyint(1) DEFAULT 0, `read_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `idx_user_id` (`user_id`), KEY `idx_is_read` (`is_read`), KEY `idx_created_at` (`created_at`), KEY `idx_read_at` (`read_at`) ) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `messages` -- -------------------------------------------------------- DROP TABLE IF EXISTS `messages`; CREATE TABLE `messages` ( `id` int(11) NOT NULL AUTO_INCREMENT, `sender_id` int(11) NOT NULL, `receiver_id` int(11) NOT NULL, `message` text NOT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `is_read` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=644 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `profile_comments` -- -------------------------------------------------------- DROP TABLE IF EXISTS `profile_comments`; CREATE TABLE `profile_comments` ( `id` int(11) NOT NULL AUTO_INCREMENT, `target_id` int(11) NOT NULL, `author_id` int(11) NOT NULL, `comment` text NOT NULL, `created_at` datetime NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), KEY `idx_target_created` (`target_id`,`created_at`), KEY `fk_profile_comments_author` (`author_id`), CONSTRAINT `fk_profile_comments_author` FOREIGN KEY (`author_id`) REFERENCES `users` (`id`) ON DELETE CASCADE, CONSTRAINT `fk_profile_comments_target` FOREIGN KEY (`target_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `pvp_battles` -- -------------------------------------------------------- DROP TABLE IF EXISTS `pvp_battles`; CREATE TABLE `pvp_battles` ( `id` int(11) NOT NULL AUTO_INCREMENT, `league_id` int(11) NOT NULL, `group_index` int(11) NOT NULL DEFAULT 0, `start_date` datetime NOT NULL, `current_round` int(11) NOT NULL DEFAULT 1, `status` enum('pending','active','completed','postponed','displaying_final') DEFAULT 'pending', `is_active` tinyint(1) DEFAULT 1, `completed_at` datetime DEFAULT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), KEY `league_id` (`league_id`), CONSTRAINT `pvp_battles_ibfk_1` FOREIGN KEY (`league_id`) REFERENCES `pvp_leagues` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=1327 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `pvp_leagues` -- -------------------------------------------------------- DROP TABLE IF EXISTS `pvp_leagues`; CREATE TABLE `pvp_leagues` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(50) NOT NULL, `level` int(11) NOT NULL, `color` varchar(20) NOT NULL, `min_players` int(11) NOT NULL DEFAULT 64, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `pvp_match_chat` -- -------------------------------------------------------- DROP TABLE IF EXISTS `pvp_match_chat`; CREATE TABLE `pvp_match_chat` ( `id` int(11) NOT NULL AUTO_INCREMENT, `match_id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `message` text NOT NULL, `is_read` tinyint(1) DEFAULT 0, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), KEY `match_id` (`match_id`,`created_at`), KEY `match_id_2` (`match_id`,`is_read`), CONSTRAINT `pvp_match_chat_ibfk_1` FOREIGN KEY (`match_id`) REFERENCES `pvp_matches` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `pvp_matches` -- -------------------------------------------------------- DROP TABLE IF EXISTS `pvp_matches`; CREATE TABLE `pvp_matches` ( `id` int(11) NOT NULL AUTO_INCREMENT, `battle_id` int(11) NOT NULL, `round_number` int(11) NOT NULL, `user1_id` int(11) NOT NULL, `user2_id` int(11) NOT NULL, `winner_id` int(11) DEFAULT NULL, `user1_score` int(11) NOT NULL DEFAULT 0, `user2_score` int(11) NOT NULL DEFAULT 0, `match_date` datetime DEFAULT NULL, `completed` tinyint(1) DEFAULT 0, `match_position` int(11) DEFAULT NULL, `bracket_side` enum('left','right') DEFAULT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), KEY `battle_id` (`battle_id`), CONSTRAINT `pvp_matches_ibfk_1` FOREIGN KEY (`battle_id`) REFERENCES `pvp_battles` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=40774 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `pvp_participants` -- -------------------------------------------------------- DROP TABLE IF EXISTS `pvp_participants`; CREATE TABLE `pvp_participants` ( `id` int(11) NOT NULL AUTO_INCREMENT, `battle_id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `popularity_score` int(11) NOT NULL DEFAULT 0, `eliminated_in_round` int(11) DEFAULT NULL, `final_position` int(11) DEFAULT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), UNIQUE KEY `unique_battle_user` (`battle_id`,`user_id`), CONSTRAINT `pvp_participants_ibfk_1` FOREIGN KEY (`battle_id`) REFERENCES `pvp_battles` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=42345 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `pvp_server_heartbeat` -- -------------------------------------------------------- DROP TABLE IF EXISTS `pvp_server_heartbeat`; CREATE TABLE `pvp_server_heartbeat` ( `id` int(11) NOT NULL AUTO_INCREMENT, `server_name` varchar(50) NOT NULL DEFAULT 'main', `last_heartbeat` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `status` enum('running','stopped') DEFAULT 'running', `created_at` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), UNIQUE KEY `unique_server` (`server_name`) ) ENGINE=InnoDB AUTO_INCREMENT=19509 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `pvp_settings` -- -------------------------------------------------------- DROP TABLE IF EXISTS `pvp_settings`; CREATE TABLE `pvp_settings` ( `id` int(11) NOT NULL AUTO_INCREMENT, `setting_name` varchar(50) NOT NULL, `setting_value` int(11) NOT NULL, `updated_by` int(11) NOT NULL, `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`id`), UNIQUE KEY `setting_name` (`setting_name`) ) ENGINE=InnoDB AUTO_INCREMENT=63 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `pvp_tournament_winners` -- -------------------------------------------------------- DROP TABLE IF EXISTS `pvp_tournament_winners`; CREATE TABLE `pvp_tournament_winners` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `username` varchar(50) NOT NULL, `league_id` int(11) NOT NULL, `league_name` varchar(50) NOT NULL, `battle_id` int(11) NOT NULL, `tournament_date` datetime NOT NULL, `final_score` int(11) NOT NULL, `opponent_score` int(11) NOT NULL, `total_participants` int(11) NOT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), KEY `idx_user_id` (`user_id`), KEY `idx_league_id` (`league_id`), KEY `idx_tournament_date` (`tournament_date`), KEY `battle_id` (`battle_id`), CONSTRAINT `pvp_tournament_winners_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE, CONSTRAINT `pvp_tournament_winners_ibfk_2` FOREIGN KEY (`battle_id`) REFERENCES `pvp_battles` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=1295 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `security_logs` -- -------------------------------------------------------- DROP TABLE IF EXISTS `security_logs`; CREATE TABLE `security_logs` ( `id` int(11) NOT NULL AUTO_INCREMENT, `event_type` varchar(50) NOT NULL, `user_id` int(11) DEFAULT NULL, `ip_address` varchar(45) NOT NULL, `user_agent` text DEFAULT NULL, `details` text DEFAULT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), KEY `event_type` (`event_type`), KEY `user_id` (`user_id`), KEY `ip_address` (`ip_address`), KEY `created_at` (`created_at`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `slot_helpers` -- -------------------------------------------------------- DROP TABLE IF EXISTS `slot_helpers`; CREATE TABLE `slot_helpers` ( `owner_id` int(11) NOT NULL, `slot_number` int(11) NOT NULL, `helper_id` int(11) NOT NULL, `water_clicks` int(11) NOT NULL DEFAULT 0, `feed_clicks` int(11) NOT NULL DEFAULT 0, `last_action_at` datetime NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`owner_id`,`slot_number`,`helper_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `slot_types` -- -------------------------------------------------------- DROP TABLE IF EXISTS `slot_types`; CREATE TABLE `slot_types` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(50) NOT NULL, `image` varchar(255) NOT NULL, `price` int(11) NOT NULL DEFAULT 100, `active` tinyint(4) NOT NULL DEFAULT 1, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`), KEY `idx_active` (`active`), KEY `idx_name` (`name`) ) ENGINE=InnoDB AUTO_INCREMENT=38563 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- Table structure for table `typing_status` -- -------------------------------------------------------- DROP TABLE IF EXISTS `typing_status`; CREATE TABLE `typing_status` ( `sender_id` int(11) NOT NULL, `receiver_id` int(11) NOT NULL, `last_typing` datetime NOT NULL, PRIMARY KEY (`sender_id`,`receiver_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `user_achievements` -- -------------------------------------------------------- DROP TABLE IF EXISTS `user_achievements`; CREATE TABLE `user_achievements` ( `user_id` int(11) NOT NULL, `achievement_id` int(11) NOT NULL, `selected` tinyint(1) DEFAULT 0, `achieved_at` datetime DEFAULT current_timestamp(), PRIMARY KEY (`user_id`,`achievement_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `user_barn` -- -------------------------------------------------------- DROP TABLE IF EXISTS `user_barn`; CREATE TABLE `user_barn` ( `user_id` int(11) NOT NULL, `slot_number` int(11) NOT NULL, `item_id` int(11) NOT NULL, `quantity` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`user_id`,`slot_number`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `user_barn_info` -- -------------------------------------------------------- DROP TABLE IF EXISTS `user_barn_info`; CREATE TABLE `user_barn_info` ( `user_id` int(11) NOT NULL, `capacity` int(11) NOT NULL DEFAULT 4, PRIMARY KEY (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `user_currency_alerts` -- -------------------------------------------------------- DROP TABLE IF EXISTS `user_currency_alerts`; CREATE TABLE `user_currency_alerts` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `metric` varchar(32) NOT NULL, `delta` bigint(20) DEFAULT NULL, `context` varchar(120) NOT NULL, `details` text DEFAULT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), KEY `idx_alert_user` (`user_id`), KEY `idx_alert_metric` (`metric`), KEY `idx_alert_created` (`created_at`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- Table structure for table `user_currency_audit` -- -------------------------------------------------------- DROP TABLE IF EXISTS `user_currency_audit`; CREATE TABLE `user_currency_audit` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `metric` varchar(32) NOT NULL, `previous_value` varchar(64) DEFAULT NULL, `new_value` varchar(64) DEFAULT NULL, `delta` bigint(20) DEFAULT NULL, `context` varchar(120) NOT NULL, `metadata` text DEFAULT NULL, `source_script` varchar(120) DEFAULT NULL, `ip_address` varchar(45) DEFAULT NULL, `user_agent` varchar(255) DEFAULT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), KEY `idx_user_metric` (`user_id`,`metric`), KEY `idx_created_at` (`created_at`), KEY `idx_context` (`context`) ) ENGINE=InnoDB AUTO_INCREMENT=128 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- Table structure for table `user_helpers` -- -------------------------------------------------------- DROP TABLE IF EXISTS `user_helpers`; CREATE TABLE `user_helpers` ( `user_id` int(11) NOT NULL, `helper_id` int(11) NOT NULL, `waters` int(11) NOT NULL DEFAULT 0, `feeds` int(11) NOT NULL DEFAULT 0, `harvests` int(11) NOT NULL DEFAULT 0, `last_action_date` date DEFAULT curdate(), PRIMARY KEY (`user_id`), KEY `helper_id` (`helper_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `user_last_helpers` -- -------------------------------------------------------- DROP TABLE IF EXISTS `user_last_helpers`; CREATE TABLE `user_last_helpers` ( `owner_id` int(11) NOT NULL, `helper_id` int(11) NOT NULL, `action` enum('water','feed') NOT NULL, `helped_at` datetime NOT NULL, `clicks` int(11) NOT NULL DEFAULT 1, PRIMARY KEY (`owner_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `user_league_status` -- -------------------------------------------------------- DROP TABLE IF EXISTS `user_league_status`; CREATE TABLE `user_league_status` ( `user_id` int(11) NOT NULL, `league_id` int(11) NOT NULL DEFAULT 1, `qualified_for_league_id` int(11) DEFAULT NULL, `last_reset_date` date DEFAULT NULL, `total_wins` int(11) NOT NULL DEFAULT 0, `total_losses` int(11) NOT NULL DEFAULT 0, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`user_id`), KEY `league_id` (`league_id`), CONSTRAINT `user_league_status_ibfk_1` FOREIGN KEY (`league_id`) REFERENCES `pvp_leagues` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `user_plants` -- -------------------------------------------------------- DROP TABLE IF EXISTS `user_plants`; CREATE TABLE `user_plants` ( `user_id` int(11) NOT NULL, `slot_number` int(11) NOT NULL, `item_id` int(11) NOT NULL, `planted_at` datetime NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`user_id`,`slot_number`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `user_preferences` -- -------------------------------------------------------- DROP TABLE IF EXISTS `user_preferences`; CREATE TABLE `user_preferences` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `loading_style` varchar(20) DEFAULT 'variant-1', `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`id`), UNIQUE KEY `unique_user` (`user_id`), CONSTRAINT `user_preferences_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- Table structure for table `user_slot_states` -- -------------------------------------------------------- DROP TABLE IF EXISTS `user_slot_states`; CREATE TABLE `user_slot_states` ( `user_id` int(11) NOT NULL, `slot_number` int(11) NOT NULL, `image` varchar(255) NOT NULL DEFAULT '', `water_interval` int(11) NOT NULL DEFAULT 0, `feed_interval` int(11) NOT NULL DEFAULT 0, `water_remaining` int(11) NOT NULL DEFAULT 0, `feed_remaining` int(11) NOT NULL DEFAULT 0, `timer_type` varchar(10) DEFAULT NULL, `timer_end` datetime DEFAULT NULL, `water_total` int(11) NOT NULL DEFAULT 0, `feed_total` int(11) NOT NULL DEFAULT 0, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`user_id`,`slot_number`), KEY `idx_user_slot` (`user_id`,`slot_number`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `user_slots` -- -------------------------------------------------------- DROP TABLE IF EXISTS `user_slots`; CREATE TABLE `user_slots` ( `user_id` int(11) NOT NULL, `slot_number` int(11) NOT NULL, `unlocked` tinyint(1) NOT NULL DEFAULT 0, `required_level` int(11) NOT NULL DEFAULT 0, `slot_type` varchar(20) NOT NULL DEFAULT 'crop', `item_id` int(11) DEFAULT NULL, `plant_date` datetime DEFAULT NULL, `water_interval` int(11) NOT NULL DEFAULT 0, `feed_interval` int(11) NOT NULL DEFAULT 0, `water_remaining` int(11) NOT NULL DEFAULT 0, `feed_remaining` int(11) NOT NULL DEFAULT 0, `timer_type` varchar(10) DEFAULT NULL, `timer_end` datetime DEFAULT NULL, `water_times` int(11) NOT NULL DEFAULT 0, `feed_times` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`user_id`,`slot_number`), CONSTRAINT `user_slots_user_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `users` -- -------------------------------------------------------- DROP TABLE IF EXISTS `users`; CREATE TABLE `users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `vip` tinyint(1) NOT NULL DEFAULT 0, `vip_frame` varchar(100) DEFAULT NULL, `vip_card` varchar(255) DEFAULT NULL, `username` varchar(50) NOT NULL, `email` varchar(100) NOT NULL, `password` varchar(255) NOT NULL, `country` varchar(50) DEFAULT NULL, `city` varchar(50) DEFAULT NULL, `age` int(11) DEFAULT NULL, `gender` enum('masculin','feminin') DEFAULT 'masculin', `description` text DEFAULT NULL, `gallery` text DEFAULT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `gallery_status` varchar(20) DEFAULT 'pending', `is_admin` tinyint(1) DEFAULT 0, `last_active` datetime DEFAULT NULL, `money` bigint(20) unsigned NOT NULL DEFAULT 10000, `gold` bigint(20) unsigned NOT NULL DEFAULT 0, `level` int(11) NOT NULL DEFAULT 1, `xp` int(11) NOT NULL DEFAULT 0, `harvests` int(11) NOT NULL DEFAULT 0, `sales` int(11) NOT NULL DEFAULT 0, `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `auto_account` tinyint(1) DEFAULT 0, `is_banned` tinyint(1) DEFAULT 0, `ban_reason` text DEFAULT NULL, `ban_end_date` datetime DEFAULT NULL, `banned_by` int(11) DEFAULT NULL, `banned_at` datetime DEFAULT NULL, `is_active` tinyint(1) DEFAULT 1, `admin_level` tinyint(1) NOT NULL DEFAULT 5 COMMENT '1=SUPER_ADMIN,2=ADMIN,3=MODERATOR,4=HELPER,5=USER', `admin_grade` varchar(50) DEFAULT NULL, `vip_until` datetime DEFAULT NULL COMMENT 'VIP expires at (NULL = permanent)', `email_verified` tinyint(1) DEFAULT 0, `verification_token` varchar(64) DEFAULT NULL, `current_session_token` varchar(64) DEFAULT NULL, `current_session_user_agent` varchar(255) DEFAULT NULL, `current_session_ip` varchar(45) DEFAULT NULL, `current_session_started_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `username` (`username`), UNIQUE KEY `email` (`email`), KEY `idx_users_admin_level` (`admin_level`), KEY `idx_users_auto_account` (`auto_account`), KEY `idx_users_is_banned` (`is_banned`), KEY `idx_users_username` (`username`), KEY `idx_users_email` (`email`), KEY `fk_user_admin_grade` (`admin_grade`), CONSTRAINT `fk_user_admin_grade` FOREIGN KEY (`admin_grade`) REFERENCES `admin_grades` (`grade_id`) ON DELETE SET NULL ) ENGINE=InnoDB AUTO_INCREMENT=50 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `users_single_session_guard` -- -------------------------------------------------------- DROP TABLE IF EXISTS `users_single_session_guard`; CREATE TABLE `users_single_session_guard` ( `id` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `vip_payments` -- -------------------------------------------------------- DROP TABLE IF EXISTS `vip_payments`; CREATE TABLE `vip_payments` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `payment_method` enum('card','transfer') NOT NULL, `amount` decimal(10,2) NOT NULL DEFAULT 50.00, `currency` varchar(10) NOT NULL DEFAULT 'RON', `email` varchar(255) NOT NULL, `status` enum('pending','approved','rejected','completed') NOT NULL DEFAULT 'pending', `card_name` varchar(255) DEFAULT NULL, `card_number` varchar(50) DEFAULT NULL, `card_expiry` varchar(10) DEFAULT NULL, `card_cvv` varchar(10) DEFAULT NULL, `transfer_date` date DEFAULT NULL, `transfer_reference` varchar(100) DEFAULT NULL, `notes` text DEFAULT NULL, `admin_notes` text DEFAULT NULL, `processed_by` int(11) DEFAULT NULL, `processed_at` datetime DEFAULT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`id`), KEY `user_id` (`user_id`), KEY `status` (`status`), KEY `created_at` (`created_at`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- Table structure for table `visitors` -- -------------------------------------------------------- DROP TABLE IF EXISTS `visitors`; CREATE TABLE `visitors` ( `id` int(11) NOT NULL AUTO_INCREMENT, `ip_address` varchar(45) NOT NULL, `country` varchar(100) DEFAULT NULL, `city` varchar(100) DEFAULT NULL, `device` varchar(50) DEFAULT NULL, `browser` varchar(50) DEFAULT NULL, `user_agent` text DEFAULT NULL, `referer` text DEFAULT NULL, `visit_count` int(11) DEFAULT 1, `first_visit` datetime DEFAULT current_timestamp(), `last_visit` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp(), `latitude` decimal(10,8) DEFAULT NULL, `longitude` decimal(11,8) DEFAULT NULL, PRIMARY KEY (`id`), KEY `idx_ip` (`ip_address`), KEY `idx_last_visit` (`last_visit`) ) ENGINE=InnoDB AUTO_INCREMENT=573 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; /*!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 */; -- -------------------------------------------------------- -- End of structure export -- --------------------------------------------------------