1
0
miroir de https://github.com/redmine/redmine.git synchronisé 2024-08-19 02:10:14 +02:00
redmine/db/migrate/20131218183023_delete_orphan_time_entries_custom_values.rb

10 lignes
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