Reputation: 12466
I'm trying something like this =>
alter table tablename modify columnname "boolean" default 1 NOT NULL;
Which is the correct format to create boolean column ?
Upvotes: 2
Views: 12626
Reputation: 113
instead of boolean use TINYINT(1). This is preferred on InnoDB database engine
Upvotes: 0
Reputation: 6044
ALTER TABLE tablename CHANGE columnname columnname BOOLEAN DEFAULT '1' NOT NULL
Is this what you are after?
Upvotes: 4
Reputation: 425063
alter table tablename modify columnname boolean default true NOT NULL;
Don't put quotes around boolean
.
I tested this on a column that was int
and it worked.
Upvotes: 3