-- Check if idx_referral_code exists and if it's unique
SHOW INDEX FROM `referrals` WHERE Column_name = 'referralCode';

-- If idx_referral_code exists and is UNIQUE (NON_UNIQUE = 0), drop it first:
-- ALTER TABLE `referrals` DROP INDEX `idx_referral_code`;

-- Then create it as non-unique:
-- CREATE INDEX `idx_referral_code` ON `referrals`(`referralCode`);

-- OR if it already exists and is non-unique (NON_UNIQUE = 1), you're done!
-- Just make sure the column itself doesn't have UNIQUE constraint

