Re: [Rails-core] [Performance Improvement Idea] Add multiple columns to table using single ALTER statement

2015-10-17 Thread Derek Prior
I believe change_table, perhaps in combination with the bulk option, will do what you want. http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-change_table > On Oct 17, 2015, at 7:25 AM, Gaurish Sharma wrote: > > To add 2 new cols to existing tab

[Rails-core] [Performance Improvement Idea] Add multiple columns to table using single ALTER statement

2015-10-17 Thread Gaurish Sharma
To add 2 new cols to existing table in migration, we will have to do: add_column :my_table, :col1, :string add_column :my_table, :col2, :string this will create 2 ALTER table statements. Alter table my_table add column col1 varchar(255) Alter table my_table add column col2 varchar(255) I