Method: ActiveRecord::ConnectionAdapters::Table#column
- Defined in:
- lib/active_record/connection_adapters/abstract/schema_definitions.rb
#column(column_name, type, options = {}) ⇒ Object
Adds a new column to the named table. See TableDefinition#column for details of the options you can use.
Example
Creating a simple column
t.column(:name, :string)
583 584 585 |
# File 'lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 583 def column(column_name, type, = {}) @base.add_column(@table_name, column_name, type, ) end |