Hello everyone!
Disclaimer: I am really, really new to Rails and this is probably a
really stupid question, but I have spent SO LONG trying to find an
answer and I’ve gotten nowhere. Thanks in advance for indulging me!
I’m trying to set up a boolean column in my database through db/
migrate/001_create_(whatever).rb. Here’s the relevant line:
t.boolean :type
When I use db:create:all to create the MySQL databases, it makes all
columns null, which is a problem for this column. I tried:
t.boolean :type, :null => false
but that didn’t work and I’m wondering if there’s a different way of
doing this in 2.0. Again, really sorry for the simple question but I
feel like I’ve looked everywhere! Help much appreciated!