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 ?

user2864740
  • 60,010
  • 15
  • 145
  • 220
Sai Sai
  • 41
  • 5

1 Answers1

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

kmoser
  • 8,780
  • 3
  • 24
  • 40