提交 d070a657 编写于 作者: S Sean Griffin

PostgreSQL timestamps are always datetimes

The current behavior is that they are treated as `datetime` normally,
but if they are part of an array, they are treated as `timestamp`. The
only place that seems to be impacted by this is schema dumping, which
shouldn't matter since `t.datetime` and `t.timestamp` are equivalent in
the `PostgreSQL` adapter, anyway.
上级 06713152
......@@ -204,11 +204,8 @@ def type_cast(value)
end
end
class Timestamp < Type
def type; :timestamp; end
def simplified_type(sql_type)
:datetime
end
class DateTime < Type
def type; :datetime; end
def type_cast(value)
return if value.nil?
......@@ -483,7 +480,7 @@ def self.registered_type?(name)
register_type 'bool', OID::Boolean.new
register_type 'bit', OID::Bit.new
alias_type 'varbit', 'bit'
register_type 'timestamp', OID::Timestamp.new
register_type 'timestamp', OID::DateTime.new
alias_type 'timestamptz', 'timestamp'
register_type 'date', OID::Date.new
register_type 'time', OID::Time.new
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册