--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: Table.new(table_name, self)
comment: 
- !ruby/struct:SM::Flow::P 
  body: A block for changing columns in <tt>table</tt>.
- !ruby/struct:SM::Flow::H 
  level: 3
  text: Example
- !ruby/struct:SM::Flow::VERB 
  body: " # change_table() yields a Table instance\n change_table(:suppliers) do |t|\n   t.column :name, :string, :limit =&gt; 60\n   # Other column alterations here\n end\n"
- !ruby/struct:SM::Flow::H 
  level: 5
  text: Examples
- !ruby/struct:SM::Flow::H 
  level: 6
  text: Add a column
- !ruby/struct:SM::Flow::VERB 
  body: " change_table(:suppliers) do |t|\n   t.column :name, :string, :limit =&gt; 60\n end\n"
- !ruby/struct:SM::Flow::H 
  level: 6
  text: Add 2 integer columns
- !ruby/struct:SM::Flow::VERB 
  body: " change_table(:suppliers) do |t|\n   t.integer :width, :height, :null =&gt; false, :default =&gt; 0\n end\n"
- !ruby/struct:SM::Flow::H 
  level: 6
  text: Add created_at/updated_at columns
- !ruby/struct:SM::Flow::VERB 
  body: " change_table(:suppliers) do |t|\n   t.timestamps\n end\n"
- !ruby/struct:SM::Flow::H 
  level: 6
  text: Add a foreign key column
- !ruby/struct:SM::Flow::VERB 
  body: " change_table(:suppliers) do |t|\n   t.references :company\n end\n"
- !ruby/struct:SM::Flow::P 
  body: Creates a <tt>company_id(integer)</tt> column
- !ruby/struct:SM::Flow::H 
  level: 6
  text: Add a polymorphic foreign key column
- !ruby/struct:SM::Flow::VERB 
  body: " change_table(:suppliers) do |t|\n   t.belongs_to :company, :polymorphic =&gt; true\n end\n"
- !ruby/struct:SM::Flow::P 
  body: Creates <tt>company_type(varchar)</tt> and <tt>company_id(integer)</tt> columns
- !ruby/struct:SM::Flow::H 
  level: 6
  text: Remove a column
- !ruby/struct:SM::Flow::VERB 
  body: " change_table(:suppliers) do |t|\n   t.remove :company\n end\n"
- !ruby/struct:SM::Flow::H 
  level: 6
  text: Remove several columns
- !ruby/struct:SM::Flow::VERB 
  body: " change_table(:suppliers) do |t|\n   t.remove :company_id\n   t.remove :width, :height\n end\n"
- !ruby/struct:SM::Flow::H 
  level: 6
  text: Remove an index
- !ruby/struct:SM::Flow::VERB 
  body: " change_table(:suppliers) do |t|\n   t.remove_index :company_id\n end\n"
- !ruby/struct:SM::Flow::P 
  body: See also Table for details on all of the various column transformation
full_name: ActiveRecord::ConnectionAdapters::SchemaStatements#change_table
is_singleton: false
name: change_table
params: (table_name) {|Table.new(table_name, self)| ...}
visibility: public
