At work today, the leader raised a question for me to revise

Modify the type of a field in a type of table in the database and its comments

First of all, it must be the type of table to query
SELECT table_name Table name , table_comment Table notes , FROM information_schema.TABLES WHERE
table_schema = ' Database name ' -- Query criteria of table name AND table_name LIKE '%doc_%' ORDER BY
table_name
The second is to modify the types and comments in the table fields
ALTER TABLE doc_add_fine_decision MODIFY re1 LONGTEXT COMMENT ' Alternate fields 1', MODIFY
re2 LONGTEXT COMMENT ' Alternate fields 2', MODIFY re3 LONGTEXT COMMENT ' Alternate fields 3', MODIFY re4
LONGTEXT COMMENT ' Alternate fields 4', MODIFY re5 LONGTEXT COMMENT ' Alternate fields 5', MODIFY re6
LONGTEXT COMMENT ' Alternate fields 6';
Then we have to consider connecting him for inquiry
SELECT table_name Table name , table_comment Table notes , CONCAT('alter table ', table_name,'
modify re1 LONGTEXT COMMENT ',''' Alternate fields 1''',',', 'modify re2 LONGTEXT COMMENT
',''' Alternate fields 2''',',', 'modify re3 LONGTEXT COMMENT ',''' Alternate fields 3''',',', 'modify re4
LONGTEXT COMMENT ',''' Alternate fields 4''',',', 'modify re5 LONGTEXT COMMENT
',''' Alternate fields 5''',',', 'modify re6 LONGTEXT COMMENT ',''' Alternate fields 6''',';') correct FROM
information_schema.TABLES WHERE table_schema = ' Database name ' AND table_name LIKE
'%doc_%' ORDER BY table_name
In this way, the modification statements of all the tables found are generated in the modification field

  Copy all correction fields and execute This will fix all the fields and types in the table

This article is for record only I hope it can provide you with reference   

Technology