In my Rails (3.2) app, I have a bunch of tables in my database but I forgot to add a few not null constraints. How can I write a migration which adds not null to an existing column?
For Rails 4+, nates' answer (using change_column_null) is better.
Pre-Rails 4, try change_column.