search for: other_column

Displaying 2 results from an estimated 2 matches for "other_column".

2006 Apr 10
1
Add Column After Column in Migrations
Adding a column to a table just places the column at the end, but I like to keep related columns together. Is there a way to specify where the column is added in a table with migrations? For example, in MySQL you can do: ALTER TABLE my_table ADD COLUMN new_column INT AFTER other_column I was hoping migrations would support something like this: add_column :my_table, :new_column, :integer, :after => :other_column I couldn''t find anything mentioned in the documentation or in a quick search of this mailing list. Thanks, Ryan
2006 Nov 29
5
AR, find(:all), loops and memory usage
...pter => "mysql", :username => "root", :password => "password", :database => "my_schema" ) class MyTable < ActiveRecord::Base end for m in MyTable.find(:all, :conditions => "some_column=''criterion to match''") m.other_column = "new value" m.save end #thanks for any tips --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3Mb...