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

[#66093] Add unique index to DB

Tobias Dillmann23caf8767c1e
diff --git a/db/migrate/20250908072653_create_calculated_value_errors.rb b/db/migrate/20250908072653_create_calculated_value_errors.rb
index 4fffd991df5..65bce264455 100644
--- a/db/migrate/20250908072653_create_calculated_value_errors.rb
+++ b/db/migrate/20250908072653_create_calculated_value_errors.rb
@@ -38,5 +38,10 @@ class CreateCalculatedValueErrors < ActiveRecord::Migration[8.0]
t.timestamps
end
+
+ add_index :calculated_value_errors,
+ %i[project_id custom_field_id error_code],
+ unique: true,
+ name: "index_unique_calc_val_error_per_project_and_cf"
end
end