-- Drop ALL unique indexes on referralCode column
-- Based on your table, you have referralCode_5 through referralCode_25 (and possibly more)

-- Drop all unique indexes (run each one)
ALTER TABLE `referrals` DROP INDEX `referralCode_5`;
ALTER TABLE `referrals` DROP INDEX `referralCode_6`;
ALTER TABLE `referrals` DROP INDEX `referralCode_7`;
ALTER TABLE `referrals` DROP INDEX `referralCode_8`;
ALTER TABLE `referrals` DROP INDEX `referralCode_9`;
ALTER TABLE `referrals` DROP INDEX `referralCode_10`;
ALTER TABLE `referrals` DROP INDEX `referralCode_11`;
ALTER TABLE `referrals` DROP INDEX `referralCode_12`;
ALTER TABLE `referrals` DROP INDEX `referralCode_13`;
ALTER TABLE `referrals` DROP INDEX `referralCode_14`;
ALTER TABLE `referrals` DROP INDEX `referralCode_15`;
ALTER TABLE `referrals` DROP INDEX `referralCode_16`;
ALTER TABLE `referrals` DROP INDEX `referralCode_17`;
ALTER TABLE `referrals` DROP INDEX `referralCode_18`;
ALTER TABLE `referrals` DROP INDEX `referralCode_19`;
ALTER TABLE `referrals` DROP INDEX `referralCode_20`;
ALTER TABLE `referrals` DROP INDEX `referralCode_21`;
ALTER TABLE `referrals` DROP INDEX `referralCode_22`;
ALTER TABLE `referrals` DROP INDEX `referralCode_23`;
ALTER TABLE `referrals` DROP INDEX `referralCode_24`;
ALTER TABLE `referrals` DROP INDEX `referralCode_25`;

-- Also drop any others that might exist (referralCode_3, referralCode_4, etc.)
ALTER TABLE `referrals` DROP INDEX `referralCode_3`;
ALTER TABLE `referrals` DROP INDEX `referralCode_4`;

-- Verify: Check remaining indexes (should only see idx_referral_code with Non_unique = 1)
SHOW INDEX FROM `referrals` WHERE Column_name = 'referralCode';

-- The idx_referral_code index (Non_unique = 1) should remain - that's the good one!

