OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/db/migrate/20211117195121_remove_destr...

17 lines
358 B

class RemoveDestroyedHelpTexts < ActiveRecord::Migration[6.1]
def up
custom_field_ids = CustomField
.pluck(:id)
.map { |id| "custom_field_#{id}"}
AttributeHelpText
.where("attribute_name LIKE 'custom_field_%'")
.where.not(attribute_name: custom_field_ids)
.destroy_all
end
def down
# Nothing to do
end
end