Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Enable all custom fields in migration

Oliver Günther02045a5bfa0d
diff --git a/db/migrate/20200903064009_enable_current_project_custom_fields_columns.rb b/db/migrate/20200903064009_enable_current_project_custom_fields_columns.rb
new file mode 100644
index 00000000000..4b3540b3025
--- /dev/null
+++ b/db/migrate/20200903064009_enable_current_project_custom_fields_columns.rb
@@ -0,0 +1,12 @@
+class EnableCurrentProjectCustomFieldsColumns < ActiveRecord::Migration[6.0]
+ def up
+ columns = Setting.enabled_projects_columns
+ cf_columns = ProjectCustomField.pluck(:id).map { |id| "cf_#{id}" }
+
+ Setting.enabled_projects_columns = (columns + cf_columns).uniq
+ end
+
+ def down
+ # Nothing to do as setting is not used
+ end
+end