script to revise MySQL data types
I have a MySQL database running for almost 4 years with new tables being
added all the time. I was wondering if there was any script that revises
all the data types in all the tables in my Db versus the actual data. And
provides a list of what to do for example there is a field:
`name` TEXT CHARACTER SET utf8 NOT NULL
the script will see all the values and find that they are all below 100
character and then recommends to change it to
ALTER TABLE `x` CHANGE `name` `name` VARCHAR( 100 ) CHARACTER SET utf8 NOT
NULL ;
same for INT and string ....etc
No comments:
Post a Comment