Skip to content

Commit ce8577f

Browse files
committed
change column indexed for burndown chart
1 parent f48d7cf commit ce8577f

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# frozen_string_literal: true
2+
3+
class ModifyBurndownIndex < ActiveRecord::Migration[8.1]
4+
INDEX_NAME = "work_package_journal_on_burndown_attributes"
5+
6+
def up
7+
remove_and_add_burndown_index :sprint_id
8+
end
9+
10+
def down
11+
remove_and_add_burndown_index :version_id
12+
end
13+
14+
private
15+
16+
def remove_and_add_burndown_index(column)
17+
remove_index :work_package_journals,
18+
name: INDEX_NAME
19+
20+
add_index :work_package_journals,
21+
[column,
22+
:status_id,
23+
:project_id,
24+
:type_id],
25+
name: INDEX_NAME
26+
end
27+
end

0 commit comments

Comments
 (0)