Skip to content

Commit 071893c

Browse files
committed
filter_by_project should be faster
1 parent f676755 commit 071893c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class AddIndexToHeartbeatsProject < ActiveRecord::Migration[8.0]
2+
# this is what i got from stackoverflow
3+
disable_ddl_transaction!
4+
5+
def change
6+
add_index :heartbeats, :project, algorithm: :concurrently
7+
add_index :heartbeats, [:project, :time], algorithm: :concurrently
8+
end
9+
end

0 commit comments

Comments
 (0)