What Changed in Rails v2.3.6 – Add Column With Positioning

RubyOnRails 31 七月 2010 | View Comments


In this commitgithub.com/rails/rails/commit/ccb197b2e6c2e773f908d3b00f5debe57c22311a Rails add a new feature that we can specify what’s the postillion to add a column.

# In migration

# add column to in first position
add_column :testings, :new_col, :integer, :first => true

# add column after another column
add_column :testings, :new_col, :integer, :after => "column_a"

# change a column with position
change_column :testings, :second, :integer, :first => true
change_column :testings, :second, :integer, :after => "column_c"

About how column position affect performance, you can see this blog post

Thanks bmarini commit this feature, also thanks jeremy reviewed this commit.




Tagged in ,

blog comments powered by Disqus

Ads Plugin created by Jake Ruston's Wordpress Plugins - Powered by and football database.