Table: account_login_history
CREATE:
CREATE TABLE `account_login_history` (
  `id` int(10) UNSIGNED NOT NULL,
  `account` varchar(45) NOT NULL,
  `ip` varchar(255) NOT NULL,
  `login_date` datetime NOT NULL,
  `is_game` tinyint(4) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
ALTERS:
ALTER TABLE `account_login_history`
  ADD PRIMARY KEY (`id`),
  ADD KEY `account_login_history_acc` (`account`),
  ADD KEY `account_loginhistory_ip` (`ip`);
ALTER TABLE `account_login_history`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=54;
----------------------------------------
Table: acm_daily_free_spins
CREATE:
CREATE TABLE `acm_daily_free_spins` (
  `id` int(11) NOT NULL,
  `account_name` varchar(255) NOT NULL,
  `date` date NOT NULL,
  `spins_used` int(11) NOT NULL DEFAULT 0,
  `max_spins_per_day` int(11) NOT NULL DEFAULT 3,
  `last_spin_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
ALTERS:
ALTER TABLE `acm_daily_free_spins`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `account_date` (`account_name`,`date`),
  ADD KEY `account_name` (`account_name`),
  ADD KEY `date` (`date`);
ALTER TABLE `acm_daily_free_spins`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
----------------------------------------
Table: acm_donation_items
CREATE:
CREATE TABLE `acm_donation_items` (
  `id` int(10) UNSIGNED NOT NULL,
  `item_id` int(10) UNSIGNED NOT NULL,
  `item_quantity` int(10) UNSIGNED NOT NULL DEFAULT 1,
  `allow_multiple` tinyint(1) NOT NULL DEFAULT 0,
  `max_quantity` int(10) UNSIGNED DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `price` decimal(10,2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
ALTERS:
ALTER TABLE `acm_donation_items`
  ADD PRIMARY KEY (`id`);
ALTER TABLE `acm_donation_items`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
----------------------------------------
Table: acm_donations
CREATE:
CREATE TABLE `acm_donations` (
  `id` int(10) UNSIGNED NOT NULL,
  `char_id` int(10) UNSIGNED DEFAULT NULL,
  `char_name` varchar(255) DEFAULT NULL,
  `account_name` varchar(255) DEFAULT NULL,
  `date_created` datetime DEFAULT NULL,
  `date_paid` datetime DEFAULT NULL,
  `donation_id` int(10) UNSIGNED DEFAULT NULL,
  `item_name` varchar(255) DEFAULT NULL,
  `payment_method` varchar(50) DEFAULT NULL,
  `price` decimal(10,2) DEFAULT NULL,
  `status` tinyint(1) DEFAULT 0,
  `payment_hash` varchar(255) DEFAULT NULL,
  `item_id_to_give` int(10) UNSIGNED DEFAULT NULL,
  `quantity_to_give` int(10) UNSIGNED DEFAULT NULL,
  `tnx_id` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
ALTERS:
ALTER TABLE `acm_donations`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `tnx_id` (`tnx_id`);
ALTER TABLE `acm_donations`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
----------------------------------------
Table: acm_donations_balance
CREATE:
CREATE TABLE `acm_donations_balance` (
  `id` int(10) UNSIGNED NOT NULL,
  `account_name` varchar(255) DEFAULT NULL,
  `date_created` datetime DEFAULT NULL,
  `date_paid` datetime DEFAULT NULL,
  `payment_method` varchar(50) DEFAULT NULL,
  `amount` decimal(10,2) DEFAULT NULL,
  `status` tinyint(1) DEFAULT 0,
  `payment_hash` varchar(255) DEFAULT NULL,
  `tnx_id` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
ALTERS:
ALTER TABLE `acm_donations_balance`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `tnx_id` (`tnx_id`);
ALTER TABLE `acm_donations_balance`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;
----------------------------------------
Table: acm_free_spin_nft_items
CREATE:
CREATE TABLE `acm_free_spin_nft_items` (
  `id` int(11) NOT NULL,
  `item_id` int(11) NOT NULL,
  `item_name` varchar(255) NOT NULL,
  `item_image` varchar(255) DEFAULT NULL,
  `rarity` enum('common','uncommon','rare','epic','legendary','mythic') NOT NULL DEFAULT 'common',
  `item_type` enum('weapon','armor','accessory','consumable','material','special') NOT NULL DEFAULT 'special',
  `item_level` int(11) DEFAULT 0,
  `item_grade` enum('none','d','c','b','a','s','s80','s84') DEFAULT 'none',
  `enchant_level` int(11) DEFAULT 0,
  `weight` int(11) NOT NULL DEFAULT 1,
  `is_active` tinyint(1) DEFAULT 1,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
ALTERS:
ALTER TABLE `acm_free_spin_nft_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `rarity` (`rarity`),
  ADD KEY `weight` (`weight`),
  ADD KEY `is_active` (`is_active`);
ALTER TABLE `acm_free_spin_nft_items`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=31;
----------------------------------------
Table: acm_lottery_configs
CREATE:
CREATE TABLE `acm_lottery_configs` (
  `id` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `cost_per_spin` decimal(10,2) NOT NULL DEFAULT 0.00,
  `min_spins` int(11) NOT NULL DEFAULT 1,
  `max_spins` int(11) NOT NULL DEFAULT 10,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
ALTERS:
ALTER TABLE `acm_lottery_configs`
  ADD PRIMARY KEY (`id`);
ALTER TABLE `acm_lottery_configs`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
----------------------------------------
Table: acm_lottery_items
CREATE:
CREATE TABLE `acm_lottery_items` (
  `id` int(11) NOT NULL,
  `lottery_config_id` int(11) NOT NULL,
  `item_id` int(11) NOT NULL,
  `item_name` varchar(255) NOT NULL,
  `item_quantity` int(11) NOT NULL DEFAULT 1,
  `item_image` varchar(255) DEFAULT NULL,
  `rarity` enum('common','uncommon','rare','epic','legendary') NOT NULL DEFAULT 'common',
  `weight` int(11) NOT NULL DEFAULT 1,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
ALTERS:
ALTER TABLE `acm_lottery_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `lottery_config_id` (`lottery_config_id`),
  ADD KEY `rarity` (`rarity`);
ALTER TABLE `acm_lottery_items`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=41;
ALTER TABLE `acm_lottery_items`
  ADD CONSTRAINT `acm_lottery_items_ibfk_1` FOREIGN KEY (`lottery_config_id`) REFERENCES `acm_lottery_configs` (`id`) ON DELETE CASCADE;
----------------------------------------
Table: acm_lottery_spin_items
CREATE:
CREATE TABLE `acm_lottery_spin_items` (
  `id` int(11) NOT NULL,
  `spin_id` int(11) NOT NULL,
  `lottery_item_id` int(11) NOT NULL,
  `item_id` int(11) NOT NULL,
  `item_name` varchar(255) NOT NULL,
  `item_quantity` int(11) NOT NULL DEFAULT 1,
  `rarity` enum('common','uncommon','rare','epic','legendary') NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
ALTERS:
ALTER TABLE `acm_lottery_spin_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `spin_id` (`spin_id`),
  ADD KEY `lottery_item_id` (`lottery_item_id`);
ALTER TABLE `acm_lottery_spin_items`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=374;
ALTER TABLE `acm_lottery_spin_items`
  ADD CONSTRAINT `acm_lottery_spin_items_ibfk_1` FOREIGN KEY (`spin_id`) REFERENCES `acm_lottery_spins` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `acm_lottery_spin_items_ibfk_2` FOREIGN KEY (`lottery_item_id`) REFERENCES `acm_lottery_items` (`id`) ON DELETE CASCADE;
----------------------------------------
Table: acm_lottery_spins
CREATE:
CREATE TABLE `acm_lottery_spins` (
  `id` int(11) NOT NULL,
  `account_name` varchar(45) NOT NULL,
  `char_id` int(11) NOT NULL,
  `char_name` varchar(35) NOT NULL,
  `lottery_config_id` int(11) NOT NULL,
  `spins_count` int(11) NOT NULL DEFAULT 1,
  `total_cost` decimal(10,2) NOT NULL,
  `won_items` text DEFAULT NULL,
  `status` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `processed_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
ALTERS:
ALTER TABLE `acm_lottery_spins`
  ADD PRIMARY KEY (`id`),
  ADD KEY `account_name` (`account_name`),
  ADD KEY `lottery_config_id` (`lottery_config_id`),
  ADD KEY `status` (`status`);
ALTER TABLE `acm_lottery_spins`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=344;
ALTER TABLE `acm_lottery_spins`
  ADD CONSTRAINT `acm_lottery_spins_ibfk_1` FOREIGN KEY (`lottery_config_id`) REFERENCES `acm_lottery_configs` (`id`) ON DELETE CASCADE;
----------------------------------------
Table: acm_nft_benefits
CREATE:
CREATE TABLE `acm_nft_benefits` (
  `id` int(11) NOT NULL,
  `rarity` enum('common','uncommon','rare','epic','legendary','mythic') NOT NULL,
  `benefit_type` enum('exp_boost','drop_rate','pvp_bonus','adena_bonus','skill_cooldown') NOT NULL,
  `benefit_value` decimal(5,2) NOT NULL,
  `min_stake_days` int(11) DEFAULT 1,
  `max_stake_days` int(11) DEFAULT 365,
  `is_active` tinyint(1) DEFAULT 1,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
ALTERS:
ALTER TABLE `acm_nft_benefits`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `rarity_benefit` (`rarity`,`benefit_type`),
  ADD KEY `rarity` (`rarity`),
  ADD KEY `benefit_type` (`benefit_type`);
ALTER TABLE `acm_nft_benefits`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=28;
----------------------------------------
Table: acm_nft_config
CREATE:
CREATE TABLE `acm_nft_config` (
  `id` int(11) NOT NULL,
  `config_key` varchar(100) NOT NULL,
  `config_value` text NOT NULL,
  `config_type` enum('string','number','boolean','json') DEFAULT 'string',
  `description` text DEFAULT NULL,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
ALTERS:
ALTER TABLE `acm_nft_config`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `config_key` (`config_key`);
ALTER TABLE `acm_nft_config`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=243;
----------------------------------------
Table: acm_nft_game_items
CREATE:
CREATE TABLE `acm_nft_game_items` (
  `id` int(11) NOT NULL,
  `token_id` int(11) NOT NULL,
  `item_id` int(11) NOT NULL,
  `item_name` varchar(255) NOT NULL,
  `item_quantity` int(11) NOT NULL DEFAULT 1,
  `item_image` varchar(255) DEFAULT NULL,
  `rarity` enum('common','uncommon','rare','epic','legendary','mythic') NOT NULL DEFAULT 'common',
  `item_type` enum('weapon','armor','accessory','consumable','material','special') NOT NULL DEFAULT 'special',
  `item_level` int(11) DEFAULT 0,
  `item_grade` enum('none','d','c','b','a','s','s80','s84') DEFAULT 'none',
  `enchant_level` int(11) DEFAULT 0,
  `acquisition_method` enum('lottery','conversion','purchase','gift','staking_reward','free_spin') DEFAULT 'lottery',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
ALTERS:
ALTER TABLE `acm_nft_game_items`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `token_id` (`token_id`),
  ADD KEY `item_id` (`item_id`),
  ADD KEY `rarity` (`rarity`),
  ADD KEY `item_type` (`item_type`),
  ADD KEY `acquisition_method` (`acquisition_method`);
ALTER TABLE `acm_nft_game_items`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
----------------------------------------
Table: acm_nft_ownership
CREATE:
CREATE TABLE `acm_nft_ownership` (
  `id` int(11) NOT NULL,
  `token_id` int(11) NOT NULL,
  `account_name` varchar(255) NOT NULL,
  `acquisition_method` enum('lottery','conversion','purchase','gift','staking_reward','free_spin') NOT NULL,
  `acquired_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
ALTERS:
ALTER TABLE `acm_nft_ownership`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `token_account` (`token_id`,`account_name`),
  ADD KEY `account_name` (`account_name`),
  ADD KEY `acquisition_method` (`acquisition_method`);
ALTER TABLE `acm_nft_ownership`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
ALTER TABLE `acm_nft_ownership`
  ADD CONSTRAINT `acm_nft_ownership_ibfk_1` FOREIGN KEY (`token_id`) REFERENCES `acm_nft_game_items` (`token_id`) ON DELETE CASCADE;
----------------------------------------
Table: acm_nft_staking
CREATE:
CREATE TABLE `acm_nft_staking` (
  `id` int(11) NOT NULL,
  `token_id` int(11) NOT NULL,
  `account_name` varchar(255) NOT NULL,
  `stake_duration` int(11) NOT NULL DEFAULT 30,
  `stake_start` timestamp NOT NULL DEFAULT current_timestamp(),
  `end_date` timestamp NULL DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT 1,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
ALTERS:
ALTER TABLE `acm_nft_staking`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `token_stake` (`token_id`,`is_active`),
  ADD KEY `account_name` (`account_name`),
  ADD KEY `is_active` (`is_active`);
ALTER TABLE `acm_nft_staking`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
ALTER TABLE `acm_nft_staking`
  ADD CONSTRAINT `acm_nft_staking_ibfk_1` FOREIGN KEY (`token_id`) REFERENCES `acm_nft_game_items` (`token_id`) ON DELETE CASCADE;
----------------------------------------
Table: acm_settings
CREATE:
CREATE TABLE `acm_settings` (
  `name` varchar(50) NOT NULL,
  `value` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
ALTERS:
ALTER TABLE `acm_settings`
  ADD PRIMARY KEY (`name`);
----------------------------------------
Table: acm_task_manager
CREATE:
CREATE TABLE `acm_task_manager` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `var1` varchar(255) DEFAULT NULL,
  `var2` varchar(255) DEFAULT NULL,
  `var3` varchar(255) DEFAULT NULL,
  `var4` varchar(255) DEFAULT NULL,
  `status` tinyint(1) NOT NULL DEFAULT 0,
  `date_created` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
ALTERS:
ALTER TABLE `acm_task_manager`
  ADD PRIMARY KEY (`id`),
  ADD KEY `acm_task_manager_status` (`status`);
ALTER TABLE `acm_task_manager`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
----------------------------------------
Table: acm_vote_reward_settings
CREATE:
CREATE TABLE `acm_vote_reward_settings` (
  `id` int(11) NOT NULL,
  `setting_key` varchar(100) NOT NULL,
  `setting_value` text NOT NULL,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Configuraþ§es do sistema de votaþÒo com recompensas';
ALTERS:
ALTER TABLE `acm_vote_reward_settings`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_setting_key` (`setting_key`);
ALTER TABLE `acm_vote_reward_settings`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
----------------------------------------
Table: acm_vote_rewards
CREATE:
CREATE TABLE `acm_vote_rewards` (
  `id` int(11) NOT NULL,
  `account_name` varchar(45) NOT NULL,
  `site_key` varchar(50) NOT NULL,
  `site_name` varchar(100) NOT NULL,
  `site_url` varchar(255) NOT NULL,
  `vote_ip` varchar(45) DEFAULT NULL,
  `vote_date` datetime NOT NULL,
  `reward_amount` decimal(10,2) NOT NULL DEFAULT 0.25,
  `status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '0=pending, 1=verified, 2=failed',
  `verification_token` varchar(64) DEFAULT NULL,
  `verified_date` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Sistema de votaþÒo com recompensas para m·ltiplos sites';
ALTERS:
ALTER TABLE `acm_vote_rewards`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_account_name` (`account_name`),
  ADD KEY `idx_site_key` (`site_key`),
  ADD KEY `idx_verification_token` (`verification_token`),
  ADD KEY `idx_status` (`status`),
  ADD KEY `idx_vote_date` (`vote_date`);
ALTER TABLE `acm_vote_rewards`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;
----------------------------------------
