I have a table:
user_id int Composite Unique (deal_id + user_id+deal_type).deal_id intdeal_type varchar.created_on datetime.This is my table. I want to create a composite unique on the user_id column so that a single user can have only unique deal_id for each deal_type.
How to make composite unique for in mysql phpmyadmin.
ALTER TABLE my_table ADD UNIQUE KEY (user_id, deal_type, deal_id);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With