Skip to content

Commit

Permalink
Pass original adapter to percona adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
xjunior committed Jul 23, 2024
1 parent 2555087 commit e07b256
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/active_record/connection_adapters/percona_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def percona_connection(config)
config = config.dup if config.frozen?
config[:username] = 'root'
end
adapter = config[:adapter]
adapter = config[:original_adapter]
connection = if Departure::SUPPORTED_ADAPTERS.include?(adapter)
send("#{adapter}_connection", config)
else
Expand Down
3 changes: 2 additions & 1 deletion lib/departure/migration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ def include_foreigner
# instead of the current adapter.
def reconnect_with_percona
return if connection_config[:adapter] == 'percona'
Departure::ConnectionBase.establish_connection(connection_config.merge(adapter: 'percona'))
Departure::ConnectionBase.establish_connection(connection_config.merge(adapter: 'percona',
original_adapter: original_adapter))
end

# Reconnect without percona adapter when Departure is disabled but was
Expand Down

0 comments on commit e07b256

Please sign in to comment.