Make migration work with existing data

I.e. don't add a null constraint when adding a column until you've
populated it for existing records.