-- Drop the unique index 'referralCode_4' that's preventing duplicates
ALTER TABLE `referrals` DROP INDEX `referralCode_4`;

-- Create a non-unique index for performance
CREATE INDEX `idx_referral_code` ON `referrals`(`referralCode`);

-- Verify it worked
SHOW INDEX FROM `referrals` WHERE Column_name = 'referralCode';

-- You should see NON_UNIQUE = 1 (duplicates allowed)

