Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Preventing Duplicate Migrations on the Same Shard #580

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/octopus/migration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class << self

def run_with_octopus(&block)
return run_without_octopus(&block) unless connection.is_a?(Octopus::Proxy)
shards = migrations.map(&:shards).flatten.map(&:to_s)
shards = migrations.map(&:shards).flatten.map(&:to_s).uniq
connection.send_queries_to_multiple_shards(shards) do
run_without_octopus(&block)
end
Expand All @@ -109,7 +109,7 @@ def run_with_octopus(&block)

def migrate_with_octopus(&block)
return migrate_without_octopus(&block) unless connection.is_a?(Octopus::Proxy)
shards = migrations.map(&:shards).flatten.map(&:to_s)
shards = migrations.map(&:shards).flatten.map(&:to_s).uniq
connection.send_queries_to_multiple_shards(shards) do
migrate_without_octopus(&block)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/octopus/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Octopus
VERSION = '0.10.2'
VERSION = '0.10.3'
end