Created
June 10, 2014 06:24
-
-
Save masamitsu-konya/54896538bc95cb06576c to your computer and use it in GitHub Desktop.
Rails migrationでカラムを追加する場所を指定する方法 ref: http://qiita.com/masamitsu-konya/items/c4f75fc02347de9f8b0f
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AddColumnToUsers < ActiveRecord::Migration | |
def change | |
add_column :users, :work_time, :time, :after => :necessary_time | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r g migration AddColumnToUsers work_time:time | |
invoke active_record | |
create db/migrate/20131202155637_add_column_to_users.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rake db:migrate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment