I have ran my migrations on my production server and I am using MySQL, I get this error:
Mysql2::Error: Invalid default value for 'admin': ALTER TABLE
users
ADDadmin
tinyint(1) DEFAULT 'false'`
my migration looks like this:
class AddAdminToUsers < ActiveRecord::Migration
def change
add_column :users, :admin, :boolean, default: :false
end
end
I understand the error is because "false" is not a proper value for a tinyint, this should be a 0 in this case. I thought default: :false was the right way to default a boolean to false.
How do I fix this so MySQL does not complain about the bad value?