tirenweb
tirenweb

Reputation: 31709

MySQL Workbench: trying to create a boolean field for a table

I'm trying to create a new column as boolean type, but I can't find it in the list..any help?

5.2.37 and ubuntu 11.10

Upvotes: 15

Views: 57950

Answers (3)

Pieter Van Keymeulen
Pieter Van Keymeulen

Reputation: 71

Skip the workbench and use the command line

alter table my_table add column my_column BOOLEAN;

Upvotes: 7

Rakesh
Rakesh

Reputation: 82765

To Create a Boolean Column in Table with default false

ALTER TABLE table_name ADD field_name tinyint(1);

if default true

ALTER TABLE table_name ADD field_name tinyint(0);   

Upvotes: 0

Widor
Widor

Reputation: 13275

There is no such thing as a 'boolean' in MySql unfortunately.

I think you need tinyint(1).

This question has more: Which MySQL data type to use for storing boolean values

Upvotes: 21

Related Questions