選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

20180501132547_add_author_id_to_time_entries.rb 323B

1234567891011
  1. class AddAuthorIdToTimeEntries < ActiveRecord::Migration[5.1]
  2. def up
  3. add_column :time_entries, :author_id, :integer, :default => nil, :after => :project_id
  4. # Copy existing user_id to author_id
  5. TimeEntry.update_all('author_id = user_id')
  6. end
  7. def down
  8. remove_column :time_entries, :author_id
  9. end
  10. end