提交 badaf353 编写于 作者: M Matthew Draper

In 4.2 migrations, `timestamps` defaulted to `null: true`

.. it also showed a deprecation warning, but we obviously needn't retain
that.
上级 f37d92c4
......@@ -4,6 +4,30 @@ module Compatibility # :nodoc: all
V5_0 = Current
module FourTwoShared
module TableDefinition
def timestamps(*, **options)
options[:null] = true if options[:null].nil?
super
end
end
def create_table(table_name, options = {})
if block_given?
super(table_name, options) do |t|
class << t
prepend TableDefinition
end
yield t
end
else
super
end
end
def add_timestamps(*, **options)
options[:null] = true if options[:null].nil?
super
end
end
class V4_2 < V5_0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册