MySQL Workbench: attempt to create a logical field for a table

I am trying to create a new column as a boolean type, but I cannot find it in the list. Any help?

5.2.37 and ubuntu 11.10

+6
source share
3 answers

Unfortunately, there is no such thing as "boolean" in MySql.

I think you need tinyint(1) .

This question has more: What type of MySQL data is used to store boolean values

+6
source

Skip the workstation and use the command line

 alter table my_table add column my_column BOOLEAN; 
+3
source

Create a Boolean Column in a table with false false

 ALTER TABLE table_name ADD field_name tinyint(1); 

if default is true

 ALTER TABLE table_name ADD field_name tinyint(0); 
+2
source

Source: https://habr.com/ru/post/909000/


All Articles