1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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.
This commit is contained in:
Sean Griffin 2014-05-17 14:04:23 -06:00
parent 067131524b
commit d070a657c0

View file

@ -204,11 +204,8 @@ This is not reliable and will be removed in the future.
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 @@ This is not reliable and will be removed in the future.
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