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

Adds a new column to the named table. See TableDefinition#column for details of the options you can use.

Sourcecode
# File src/rails-1.2.2/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb, line 121
      def add_column(table_name, column_name, type, options = {})
        add_column_sql = "ALTER TABLE #{table_name} ADD #{quote_column_name(column_name)} #{type_to_sql(type, options[:limit], options[:precision], options[:scale])}"
        add_column_options!(add_column_sql, options)
        execute(add_column_sql)
      end
Add New Note User Added Notes
tfwright AT gmail . com
+34 vote [up] [down] [spam] Added To Version 1.1.2 on 08-Aug-2006 00:46
Beware the timestamp datatype!

While the wiki (http://wiki.rubyonrails.org/rails/pages/UsingMigrations) lists timestamp as one of the valid data types as of this writing, such fields will automatically be converted to datetimes by the migration. Apparently this is desired behavior to ensure database neutrality (http://lists.rubyonrails.org/pipermail/rails/2006-May/039934.html). Rails will "automagically" take care of timestamping if you create a field with the name "created_at" or "updated_at" that is defined as either timestamp or datetime (Why allow the timestamp type in this case at all is up to debate).