Null: false for t.timestamps changed in Rails 4.x?

I ran into an issue where running “annotate -i” removes the not null constraint from timestamps.

I found this SO article: Rails generate migration does not set :null => false to created_at and update_at - Stack Overflow

Seems like maybe the default behavior changed, and if I recreated my development database from migrations, then the schema.rb file wants to change by having “not null” removed.

@greg, any info?

Anybody else?

I’m not sure what annotate is doing, but you can re-load your schema to get your local db in sync.

Hi @greg, I think annotate is reading the development DB. So what’s happened is that maybe the behavior t.timestamps changed, and I rebuilt the DB from the migrations.

I suppose it might be worth downloading my production DB and running annotate against that and seeing if the “not null” changes in the model annotations.