Add migration from work_packages_export_limit to new setting

The `work_packages_export_limit` was renmaed to `work_packages_projects_export_limit`,
but the previous values were not retained.

https://community.openproject.org/work_packages/43642
pull/11134/head
Oliver Günther 2 years ago
parent 2081de3b43
commit da5ce8708f
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 19
      db/migrate/20220811061024_rename_work_package_export_limit.rb

@ -0,0 +1,19 @@
class RenameWorkPackageExportLimit < ActiveRecord::Migration[7.0]
def up
if Setting.exists?(name: 'work_packages_projects_export_limit')
Setting
.where(name: 'work_packages_export_limit')
.delete_all
else
Setting
.where(name: 'work_packages_export_limit')
.update_all(name: 'work_packages_projects_export_limit')
end
end
def down
Setting
.where(name: 'work_packages_projects_export_limit')
.update_all(name: 'work_packages_export_limit')
end
end
Loading…
Cancel
Save