Flowdock
method

add_column

Importance_0
add_column(table_name, column_name, type, options = {}) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb, line 314
      def add_column(table_name, column_name, type, options = {})
        execute("ALTER TABLE #{table_name} ADD #{column_name} #{type_to_sql(type, options[:limit])}")
        execute("ALTER TABLE #{table_name} ALTER #{column_name} SET NOT NULL") if options[:null] == false
        change_column_default(table_name, column_name, options[:default]) unless options[:default].nil?
      end
Register or log in to add new notes.