G
G
GS32020-06-08 23:55:31
MySQL
GS3, 2020-06-08 23:55:31

How to re-index a linked table?

How to re-index a linked table?
I have table A and it is related to table B many-to-many, how is re-indexing done in this case?

Thought like this:

ALTER TABLE A ADD COLUMN id2 int unsigned not null;
SET @a:=0;
UPDATE A SET [email protected]:[email protected]+;
ALTER TABLE A DROP id;


But naturally it will not let you do it because of the connection.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Tsvetkov, 2020-06-09
@tsklab

Change immediately idby setting ON UPDATE CASCADE first .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question