add_column(table_name, column_name, type, options = {}) Ver: 1.1.4
From: ActiveRecord::ConnectionAdapters::PostgreSQLAdapter Version 1.1.4
Comments

Sourcecode
# File src/rails-1.1.4/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
Add New Note User Added Notes