method

add_column_options!

rails latest stable - Class: ActiveRecord::ConnectionAdapters::SchemaCreation
add_column_options!(sql, options)
private

No documentation available.

# File activerecord/lib/active_record/connection_adapters/abstract/schema_creation.rb, line 151
        def add_column_options!(sql, options)
          sql << " DEFAULT #{quote_default_expression(options[:default], options[:column])}" if options_include_default?(options)
          # must explicitly check for :null to allow change_column to work on migrations
          if options[:null] == false
            sql << " NOT NULL"
          end
          if options[:auto_increment] == true
            sql << " AUTO_INCREMENT"
          end
          if options[:primary_key] == true
            sql << " PRIMARY KEY"
          end
          sql
        end