Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ssis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 从迁移文件中删除Rails 4.2不推荐_Ruby On Rails_Migration_Deprecation Warning - Fatal编程技术网

Ruby on rails 从迁移文件中删除Rails 4.2不推荐

Ruby on rails 从迁移文件中删除Rails 4.2不推荐,ruby-on-rails,migration,deprecation-warning,Ruby On Rails,Migration,Deprecation Warning,我将把我的应用程序迁移到Rails 5。因此,我现在正在执行删除所有Rails 4.2弃用的过程。我得到了下面的弃用警告 DEPRECATION WARNING: `#timestamps` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to pr

我将把我的应用程序迁移到Rails 5。因此,我现在正在执行删除所有Rails 4.2弃用的过程。我得到了下面的弃用警告

DEPRECATION WARNING: `#timestamps` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in up at 
因为我所有的迁移文件都没有

null: false

对于“我的时间戳”字段,如何避免引发此不推荐?

您可以安全地向迁移中的所有时间戳字段添加
null:false
。这将不会再次运行迁移。所有以前运行的迁移ID都存储在名为
schema\u migrations
的数据库表中。只要此表包含相应的迁移id,简单文件修改将不会导致迁移重新运行。

如果在所有迁移中向所有时间戳添加
null:true
,不推荐将消失。这是否会再次运行我的迁移?或者siml更改它将影响我的数据库数据,因为我将要这样做,这也是生产环境吗?