From bcf32355f1178d3d0d9dbb7b51f194c0f397cbf7 Mon Sep 17 00:00:00 2001 From: Victor Miao Date: Mon, 10 May 2021 16:25:15 -0700 Subject: [PATCH] DEV-7136 #time 5m Explicitly handle 'smallint' and 'bigint' sql types, to prevent a limit clause being added. --- .../connection_adapters/redshift/schema_statements.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/active_record/connection_adapters/redshift/schema_statements.rb b/lib/active_record/connection_adapters/redshift/schema_statements.rb index 2852275..bb08511 100644 --- a/lib/active_record/connection_adapters/redshift/schema_statements.rb +++ b/lib/active_record/connection_adapters/redshift/schema_statements.rb @@ -429,6 +429,10 @@ def index_name_length # Maps logical Rails types to PostgreSQL-specific data types. def type_to_sql(type, limit: nil, precision: nil, scale: nil, **) case type.to_s + when 'smallint' + return 'smallint' + when 'bigint' + return 'bigint' when 'integer', 'int' return 'integer' unless limit