ALTER TABLE your_table DROP INDEX user_id, ADD UNIQUE KEY `user_id` (`user_id`,`account_id`,`pet_id`)