T
T
tolsor2018-05-03 12:49:03
MySQL
tolsor, 2018-05-03 12:49:03

How to make a column unique after creating a db table?

I created a table in the database and realized that I forgot to make the column unique. I go to the "Structure" tab, check the column in A_I, save - an error pops up:
5aead9d2897c7153279085.png

Answer the question

In order to leave comments, you need to log in

4 answer(s)
I
Ilya, 2018-05-03
@tolsor

“Structure” tab → click next to the desired column “Primary” → “Edit” → tick A_I

L
longclaps, 2018-05-03
@longclaps

mysql alter table
ps looked at the screenshot - and there kod_parent . I don't know how to help here.

A
Alexander Aksentiev, 2018-05-03
@Sanasol

A_I is not a unique column, but an auto-increment column.
Read about indexes, or rather unique indexes.

L
leni_m, 2018-05-03
@leni_m

click the structure, look for the line where kod_parent is written in bold and on the right side of this line the squares are different, when you hover over, you can find a unique square.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question