I have a table:
table votes (
id,
user,
email,
address,
primary key(id),
);
Now I want to make the columns user
For adding unique index following are required:
1) table_name
2) index_name
3) columns on which you want to add index
ALTER TABLE `tablename`
ADD UNIQUE index-name
(`column1` ,`column2`,`column3`,...,`columnN`);
In your case we can create unique index as follows:
ALTER TABLE `votes`ADD
UNIQUE ;(`user` ,`email`,`address`);