3

In our current database, We have a lot of tables without a comment on the column. We would like to add comments to columns, but

 ALTER TABLE `user` CHANGE `id` `id` INT( 11 ) COMMENT 'id of user' 

will change the column data schema,too.

We are afraid that with so many changes, a mistake would be made and the data schema would be accidentally altered.

What would be the best way to insert the comments with no change to the data schema ?

1 Answer 1

1

This script creates the required ALTER TABLE statements. After running it, change the comments descriptions, then run those ALTER TABLE statements.

https://stackoverflow.com/a/17791564/378779

Sign up to request clarification or add additional context in comments.

2 Comments

ok,thank you. the script is the a good way to do such dangerous thing
@SaiSai If this post answers your question, please mark it as such, thanks!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.