instance method change_column_null

Ruby on Rails 3.1.12

Since v3.1.12 Last seen in v3.1.12

Signature

change_column_null(table_name, column_name, null, default = nil)

No documentation comment.

Parameters

table_name req
column_name req
null req
default opt = nil
Source
# File activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb, line 503
      def change_column_null(table_name, column_name, null, default = nil)
        column = column_for(table_name, column_name)

        unless null || default.nil?
          execute("UPDATE #{quote_table_name(table_name)} SET #{quote_column_name(column_name)}=#{quote(default)} WHERE #{quote_column_name(column_name)} IS NULL")
        end

        change_column table_name, column_name, column.sql_type, :null => null
      end

Defined in activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb line 503 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::ConnectionAdapters::Mysql2Adapter

Type at least 2 characters to search.

↑↓ navigate · open · esc close