Skip to content

Commit

Permalink
Allow disable switcher
Browse files Browse the repository at this point in the history
  • Loading branch information
perryism committed Jan 26, 2018
1 parent 0a192db commit 28b35e5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/lhm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def sync_table(table_name, sync_table, options = {}, &block)
origin = Table.parse(table_name, connection)
invoker = Invoker.new(origin, connection)
block.call(invoker.migrator)
options.merge!({disable_switcher: true})
invoker.run(options)
ensure
Lhm::Table.naming_strategy = nil
Expand Down
10 changes: 7 additions & 3 deletions lib/lhm/invoker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,14 @@ def run(options = {})

Entangler.new(migration, @connection).run do
Chunker.new(migration, @connection, options).run
if options[:atomic_switch]
AtomicSwitcher.new(migration, @connection).run
if options[:disable_switcher]
Lhm.logger.debug 'switcher is disabled'
else
LockedSwitcher.new(migration, @connection).run
if options[:atomic_switch]
AtomicSwitcher.new(migration, @connection).run
else
LockedSwitcher.new(migration, @connection).run
end
end
end
end
Expand Down

0 comments on commit 28b35e5

Please sign in to comment.