Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save masamitsu-konya/54896538bc95cb06576c to your computer and use it in GitHub Desktop.
Save masamitsu-konya/54896538bc95cb06576c to your computer and use it in GitHub Desktop.
Rails migrationでカラムを追加する場所を指定する方法 ref: http://qiita.com/masamitsu-konya/items/c4f75fc02347de9f8b0f
class AddColumnToUsers < ActiveRecord::Migration
def change
add_column :users, :work_time, :time, :after => :necessary_time
end
end
r g migration AddColumnToUsers work_time:time
invoke active_record
create db/migrate/20131202155637_add_column_to_users.rb
rake db:migrate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment