I did my migrations on my working server and I use MySQL, I get this error:
Mysql2 :: Error: Invalid default value for 'admin': ALTER TABLE users ADD admin tinyint (1) DEFAULT 'false``
my migration is as follows:
class AddAdminToUsers < ActiveRecord::Migration def change add_column :users, :admin, :boolean, default: :false end end
I understand that the error is due to the fact that "false" is not the correct value for tinyint, in this case it should be 0. I thought that default :: false was the correct default way for boolean to false.
How to fix this, so MySQL is not complaining about a bad value?
Jeffc source share