Migrating Varchar to Text in Mysql

ted picture ted · Jun 23, 2016 · Viewed 21.9k times · Source

I am converting one of the "Varchar" column in mysql table to a text field. I am simply using single alter command to convert the type. When i read about text and varchar came to know that it had difference in storing mechanisms.

Am I supposed to write any migration script to change the type of column and move data or a single type altering command is enough ?

Answer

Shusen Yi picture Shusen Yi · Sep 26, 2018
ALTER TABLE table_name MODIFY column_name TEXT NOT NULL;