6
I wonder if it is possible to change the data type of a column in Mysql. For example: I have a table USUARIO
with the column SITUACAO
, in varchar
and need to change to bit
. I thought I’d do something like:
UPDATE usuario SET situacao=1 WHERE situacao='ativo';
UPDATE usuario SET situacao=0 WHERE situacao='inativo';
afterward
ALTER TABLE usuario CHANGE situacao situacao BIT;
Will it work? Someone knows a better way to do it ?
Yeah, I can back up the column to the table itself. Thanks for the tip !!!
– goldenleticia