Skip to content

Commit c100d31

Browse files
committed
Use bigint type in sqlserver_type when needed. Fixes #616
1 parent 99f1faf commit c100d31

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/active_record/connection_adapters/sqlserver/database_statements.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def sp_executesql_sql_type(attr)
247247
return attr.type.sqlserver_type if attr.type.respond_to?(:sqlserver_type)
248248
case value = attr.value_for_database
249249
when Numeric
250-
'int'.freeze
250+
value > 2_147_483_647 ? 'bigint'.freeze : 'int'.freeze
251251
else
252252
'nvarchar(max)'.freeze
253253
end

0 commit comments

Comments
 (0)