I wonder if it is possible to change the data type of a column in Mysql. For example: I have a USUARIO
table with the SITUACAO
column, in varchar
and need to change to bit
. I thought about doing something like:
UPDATE usuario SET situacao=1 WHERE situacao='ativo';
UPDATE usuario SET situacao=0 WHERE situacao='inativo';
after
ALTER TABLE usuario CHANGE situacao situacao BIT;
Will this work? Does anyone know a better way to do this?