You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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