From a8398e0e5bac41cfdb8cbde7095d7b6729b8d2ed Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Wed, 12 Feb 2020 16:42:33 +0900 Subject: [PATCH] `OID` type should accept a value range of unsigned integers Related #38425. --- .../lib/active_record/connection_adapters/postgresql/oid/oid.rb | 2 +- activerecord/test/cases/adapters/postgresql/datatype_test.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/oid/oid.rb b/activerecord/lib/active_record/connection_adapters/postgresql/oid/oid.rb index d8c044320d..86d84b00ec 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql/oid/oid.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql/oid/oid.rb @@ -4,7 +4,7 @@ module ActiveRecord module ConnectionAdapters module PostgreSQL module OID # :nodoc: - class Oid < Type::Integer # :nodoc: + class Oid < Type::UnsignedInteger # :nodoc: def type :oid end diff --git a/activerecord/test/cases/adapters/postgresql/datatype_test.rb b/activerecord/test/cases/adapters/postgresql/datatype_test.rb index 562cf1f2d1..116a523726 100644 --- a/activerecord/test/cases/adapters/postgresql/datatype_test.rb +++ b/activerecord/test/cases/adapters/postgresql/datatype_test.rb @@ -55,7 +55,7 @@ class PostgresqlDataTypeTest < ActiveRecord::PostgreSQLTestCase end def test_update_oid - new_value = 567890 + new_value = 2147483648 @first_oid.obj_id = new_value assert @first_oid.save assert @first_oid.reload