Rails: differences in db/schema.rb - null: false at created_at/updated_at columns

前端 未结 2 1172
不思量自难忘°
不思量自难忘° 2021-02-20 12:48

Does anybody know why whenever I run rake db:migrate in my production environment, the schema.rb file is changed?

The differences are only on the created_at

相关标签:
2条回答
  • 2021-02-20 13:14

    Check your mysql version in production system and system where you used in development mode. There was a similar issue with default values.

    Check this link : https://www.ruby-forum.com/topic/134121

    0 讨论(0)
  • 2021-02-20 13:34

    I had the same thing on my dev machine. Running db:drop in production is not a wise idea, but what will fix the 'problem':

    rake db:drop db:create db:migrate
    

    My mysql version had changed since I first created the database with rails. The migrations still ran according to the old mysql version.

    This is what probabaly happens at your production environment.

    0 讨论(0)
提交回复
热议问题