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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Build index concurrently after adding data
Klaus Zandersc0b2aafdf715
diff --git a/modules/costs/db/migrate/20250416095154_add_entity_to_time_entry.rb b/modules/costs/db/migrate/20250416095154_add_entity_to_time_entry.rbindex a6a0c4e2c9d..7c9a2e83110 100644--- a/modules/costs/db/migrate/20250416095154_add_entity_to_time_entry.rb+++ b/modules/costs/db/migrate/20250416095154_add_entity_to_time_entry.rb@@ -2,8 +2,8 @@class AddEntityToTimeEntry < ActiveRecord::Migration[8.0]def up- add_reference :time_entries, :entity, polymorphic: true, index: true- add_reference :time_entry_journals, :entity, polymorphic: true, index: true+ add_reference :time_entries, :entity, polymorphic: true+ add_reference :time_entry_journals, :entity, polymorphic: trueexecute <<~SQL.squishUPDATE time_entriesdiff --git a/modules/costs/db/migrate/20250416112143_add_entity_to_cost_entry.rb b/modules/costs/db/migrate/20250416112143_add_entity_to_cost_entry.rbindex 2be947243a0..2dc8ed88555 100644--- a/modules/costs/db/migrate/20250416112143_add_entity_to_cost_entry.rb+++ b/modules/costs/db/migrate/20250416112143_add_entity_to_cost_entry.rb@@ -2,7 +2,7 @@class AddEntityToCostEntry < ActiveRecord::Migration[8.0]def up- add_reference :cost_entries, :entity, polymorphic: true, index: true+ add_reference :cost_entries, :entity, polymorphic: truechange_column_null :cost_entries, :work_package_id, trueexecute <<~SQL.squishdiff --git a/modules/costs/db/migrate/20250709090813_add_entity_index_for_costs.rb b/modules/costs/db/migrate/20250709090813_add_entity_index_for_costs.rbnew file mode 100644index 00000000000..2e32922eb8a--- /dev/null+++ b/modules/costs/db/migrate/20250709090813_add_entity_index_for_costs.rb@@ -0,0 +1,11 @@+# frozen_string_literal: true++class AddEntityIndexForCosts < ActiveRecord::Migration[8.0]+ disable_ddl_transaction!++ def change+ add_index :time_entries, %i[entity_type entity_id], algorithm: :concurrently+ add_index :time_entry_journals, %i[entity_type entity_id], algorithm: :concurrently+ add_index :cost_entries, %i[entity_type entity_id], algorithm: :concurrently+ end+end