From 1a88a550dc425e9466957856b52031c89dfe0f21 Mon Sep 17 00:00:00 2001 From: Leonid Shevtsov Date: Fri, 6 Oct 2023 10:35:13 +0300 Subject: [PATCH] Fix limit on int8 columns (#8) --- lib/active_record/connection_adapters/redshift_adapter.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/active_record/connection_adapters/redshift_adapter.rb b/lib/active_record/connection_adapters/redshift_adapter.rb index 939bb58..545214c 100644 --- a/lib/active_record/connection_adapters/redshift_adapter.rb +++ b/lib/active_record/connection_adapters/redshift_adapter.rb @@ -344,9 +344,9 @@ def translate_exception(exception, message:, sql:, binds:) class << self def initialize_type_map(m) # :nodoc: - register_class_with_limit m, 'int2', Type::Integer - register_class_with_limit m, 'int4', Type::Integer - register_class_with_limit m, 'int8', Type::Integer + m.register_type 'int2', Type::Integer.new(limit: 2) + m.register_type 'int4', Type::Integer.new(limit: 4) + m.register_type 'int8', Type::Integer.new(limit: 8) m.alias_type 'oid', 'int2' m.register_type 'float4', Type::Float.new m.alias_type 'float8', 'float4'