diff options
author | Tarmo Tänav <tarmo@itech.ee> | 2008-08-23 19:51:09 +0300 |
---|---|---|
committer | Tarmo Tänav <tarmo@itech.ee> | 2008-08-23 19:51:09 +0300 |
commit | 74c3c701f73407a5bb1a11be2b5b221fe39895d3 (patch) | |
tree | 995e5671c3b99b161b4a65e11657fc946acbc02b /activerecord/lib/active_record/connection_adapters | |
parent | 5232d812819d1d44187a54cb025835b1f9cb2296 (diff) | |
download | rails-74c3c701f73407a5bb1a11be2b5b221fe39895d3.tar.gz rails-74c3c701f73407a5bb1a11be2b5b221fe39895d3.tar.bz2 rails-74c3c701f73407a5bb1a11be2b5b221fe39895d3.zip |
Don't set "NULL" as a constraint on nullable columns [#398 state:resolved]
This is already the default and adding it breaks SQL standards compatibility.
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb index 0f60a91ef1..bececf82a0 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb @@ -384,12 +384,8 @@ module ActiveRecord def add_column_options!(sql, options) #:nodoc: sql << " DEFAULT #{quote(options[:default], options[:column])}" if options_include_default?(options) # must explicitly 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 + if options[:null] == false + sql << " NOT NULL" end end |