How to change a nullable column to not nullable in a Rails migration?

I created a date column in a previous migration and set it to be nullable. Now I want to change it to be not nullable. How do I go about doing this assuming there are null rows in that database? I’m ok with setting those columns to Time.now if they’re currently null.

8 Answers
8

Leave a Comment