Skip to content

Commit

Permalink
Merge pull request #262 from OpenHistoricalMap/migration/index
Browse files Browse the repository at this point in the history
Add  condition to check index in user_blocks
  • Loading branch information
Rub21 authored Jan 17, 2025
2 parents ee66685 + 6851f38 commit eb75bd5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions db/migrate/20240405083825_add_creator_index_to_user_blocks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ class AddCreatorIndexToUserBlocks < ActiveRecord::Migration[7.1]
disable_ddl_transaction!

def change
add_index :user_blocks, [:creator_id, :id], :algorithm => :concurrently
unless index_exists?(:user_blocks, [:creator_id, :id])
add_index :user_blocks, [:creator_id, :id], algorithm: :concurrently
end
end
end
end

0 comments on commit eb75bd5

Please sign in to comment.