Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #11561: schema_statements.rb.patch

File schema_statements.rb.patch, 1.0 kB (added by nwiger, 3 months ago)

Patch to schema_statements.rb against Edge

  • vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb

    old new  
    281281 
    282282      def add_column_options!(sql, options) #:nodoc: 
    283283        sql << " DEFAULT #{quote(options[:default], options[:column])}" if options_include_default?(options) 
    284         sql << " NOT NULL" if options[:null] == false 
     284        # must explcitly check for :null to allow change_column to work on migrations 
     285        if options.has_key? :null 
     286          if options[:null] == false 
     287            sql << " NOT NULL" 
     288          else 
     289            sql << " NULL" 
     290          end 
     291        end 
    285292      end 
    286293 
    287294      # SELECT DISTINCT clause for a given set of columns and a given ORDER BY clause.