mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #15156 from sgrif/sg-postgres-timestamps
PostgreSQL timestamps should always be datetimes
This commit is contained in:
commit
d29074af7a
1 changed files with 3 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue