Fixed that change_column should be able to use :null => true on a field that...

Fixed that change_column should be able to use :null => true on a field that formerly had false [Nate Wiger] [#26 state:resolved]
上级 5514baf6
*SVN*
* Fixed that change_column should be able to use :null => true on a field that formerly had false [Nate Wiger] [#26]
* Added that the MySQL adapter should map integer to either smallint, int, or bigint depending on the :limit just like PostgreSQL [DHH]
* Change validates_uniqueness_of :case_sensitive option default back to true (from [9160]). Love your database columns, don't LOWER them. [rick]
......
......@@ -297,7 +297,14 @@ def type_to_sql(type, limit = nil, precision = nil, scale = nil) #:nodoc:
def add_column_options!(sql, options) #:nodoc:
sql << " DEFAULT #{quote(options[:default], options[:column])}" if options_include_default?(options)
sql << " NOT NULL" if options[:null] == false
# must explcitly check for :null to allow change_column to work on migrations
if options.has_key? :null
if options[:null] == false
sql << " NOT NULL"
else
sql << " NULL"
end
end
end
# SELECT DISTINCT clause for a given set of columns and a given ORDER BY clause.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册