mirror of
https://github.com/redmine/redmine.git
synced 2024-07-28 20:17:48 +02:00
10 lines
268 B
Ruby
10 lines
268 B
Ruby
![]() |
class DeleteOrphanTimeEntriesCustomValues < ActiveRecord::Migration
|
||
|
def up
|
||
|
CustomValue.where("customized_type = ? AND NOT EXISTS (SELECT 1 FROM #{TimeEntry.table_name} t WHERE t.id = customized_id)", "TimeEntry").delete_all
|
||
|
end
|
||
|
|
||
|
def down
|
||
|
# nop
|
||
|
end
|
||
|
end
|