How to specify order of field to add using migration in Rails 3?
问题 How can I specify after which field I want to add a new column? (I don't want the field added in at the bottom after the timestamps) add_column :users, :is_active, :boolean 回答1: Here is how: add_column :users, :is_active, :boolean, :after => :some_column where :some_column is the name of the column you want to add :is_active after. 回答2: In general, you can't and you shouldn't care. Tables in relational databases don't really have any particular order; that's why you should always specify the