From 2fdbcd35dd8cc2f6b98340825a57afd24ff89670 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 16 Dec 2018 16:28:22 +0000 Subject: Adds a permission to log time for another user (#3848). Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@17755 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- db/migrate/20180501132547_add_author_id_to_time_entries.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 db/migrate/20180501132547_add_author_id_to_time_entries.rb (limited to 'db/migrate') diff --git a/db/migrate/20180501132547_add_author_id_to_time_entries.rb b/db/migrate/20180501132547_add_author_id_to_time_entries.rb new file mode 100644 index 000000000..3d79bf210 --- /dev/null +++ b/db/migrate/20180501132547_add_author_id_to_time_entries.rb @@ -0,0 +1,11 @@ +class AddAuthorIdToTimeEntries < ActiveRecord::Migration[5.1] + def up + add_column :time_entries, :author_id, :integer, :default => nil, :after => :project_id + # Copy existing user_id to author_id + TimeEntry.update_all('author_id = user_id') + end + + def down + remove_column :time_entries, :author_id + end +end -- cgit v1.2.3