Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:Fedora Linux 9, Sun Java 1.6.0_06, JRuby trunk (rev 8935), DerbyDB 10.2.2.0
-
Number of attachments :
Description
When giving a :limit => 4 option to an integer field in a migration, and running it agawinst a berdy database, the generated DDL is converted to a INTEGER(4) type. Derby does not support this and fails. The jdbcderby adapter should ignore the :limit option for integers.
I have a fix:
Add the following section at the bottom of
lib/active_record/connection_adapters/derby_adapter.rb
module ActiveRecord
module ConnectionAdapters # :nodoc:
module SchemaStatements
def type_to_sql_with_suppress_integer_limit(type, limit = nil, precision = nil, scale = nil) #:nodoc:
type_to_sql_without_suppress_integer_limit(type, type == :integer ? nil : limit, precision, scale)
end
alias_method_chain :type_to_sql, :suppress_integer_limit
end
end
end