-- Step 1: Find the exact index name on referralCode
SHOW INDEX FROM `referrals` WHERE Column_name = 'referralCode';

-- This will show you all indexes on the referralCode column
-- Look for the one with NON_UNIQUE = 0 (that's the unique one)

-- Step 2: Once you see the index name, drop it
-- Replace 'INDEX_NAME_HERE' with the actual name from Step 1
-- ALTER TABLE `referrals` DROP INDEX `INDEX_NAME_HERE`;

-- Step 3: Create non-unique index
CREATE INDEX `idx_referral_code` ON `referrals`(`referralCode`);

-- Step 4: Verify
SHOW INDEX FROM `referrals` WHERE Column_name = 'referralCode';

