-- ============================================================
-- Fix recharge table missing columns
-- Run this in phpMyAdmin on your mtplayyyy database
-- ============================================================
USE mtplayyyy;

ALTER TABLE recharge ADD COLUMN IF NOT EXISTS transaction_id VARCHAR(100) NOT NULL DEFAULT 'NULL';
ALTER TABLE recharge ADD COLUMN IF NOT EXISTS url VARCHAR(255) NOT NULL DEFAULT 'NULL';
ALTER TABLE recharge ADD COLUMN IF NOT EXISTS utr VARCHAR(100) NOT NULL DEFAULT '';
ALTER TABLE recharge ADD COLUMN IF NOT EXISTS type VARCHAR(50) NOT NULL DEFAULT 'manual';
ALTER TABLE recharge ADD COLUMN IF NOT EXISTS remaining_bet DECIMAL(15,2) NOT NULL DEFAULT 0;
ALTER TABLE recharge ADD COLUMN IF NOT EXISTS time_remaining_bet BIGINT NOT NULL DEFAULT 0;
ALTER TABLE recharge ADD COLUMN IF NOT EXISTS screenshot VARCHAR(1000) NOT NULL DEFAULT '';

SELECT CONCAT('recharge table now has ', COUNT(*), ' columns') AS status
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = 'mtplayyyy' AND TABLE_NAME = 'recharge';
