summaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2018-12-16 16:28:22 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2018-12-16 16:28:22 +0000
commit2fdbcd35dd8cc2f6b98340825a57afd24ff89670 (patch)
treebf05ccb4c0ad1109229cea2b5309fab4c27f8e51 /db
parent537f162f27d91ad99fadd4be74c878adf33f0583 (diff)
downloadredmine-2fdbcd35dd8cc2f6b98340825a57afd24ff89670.tar.gz
redmine-2fdbcd35dd8cc2f6b98340825a57afd24ff89670.zip
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
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20180501132547_add_author_id_to_time_entries.rb11
1 files changed, 11 insertions, 0 deletions
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