mirror of
https://github.com/redmine/redmine.git
synced 2026-07-11 20:51:28 +02:00
Add migration to delete orphaned time entry activities (#36416).
Patch by Holger Just. git-svn-id: http://svn.redmine.org/redmine/trunk@21438 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
class DeleteOrphanedTimeEntryActivities < ActiveRecord::Migration[6.1]
|
||||
def self.up
|
||||
TimeEntryActivity.left_outer_joins(:project).where(projects:{id: nil}).where.not(project_id: nil).delete_all
|
||||
end
|
||||
|
||||
def self.down
|
||||
# no-op
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user