If I use the following commands:
ALTER TABLE yourtab CHANGE `$colname1` `$colname2` VARCHAR(20) NOT NULL;
ALTER TABLE yourtab MODIFY `$colname1` `$colname2` VARCHAR(20) NOT NULL;
ALTER TABLE yourtab CHANGE COLUMN `$colname1` `$colname2` VARCHAR(20) NOT NULL;
And because I use a variable inside a loop I can change an array of column names. The challenge I'm facing is that VARCHAR or other type formats are obviously obliged.
is that true?
Is there a possibility to change a column name and keep the type set as the original table create settings?