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

[2.x] Don't purge central connections #189

Merged
merged 4 commits into from
Oct 19, 2019
Merged

[2.x] Don't purge central connections #189

merged 4 commits into from
Oct 19, 2019

Conversation

stancl
Copy link
Member

@stancl stancl commented Oct 19, 2019

Fixes #176

The endTenancy() method (indirectly) calls DatabaseManager::reconnect() which reconnects the default database back to the central database. That method purges the connection that we are switching to - this makes sense in case of switching tenants, to purge the 'tenant' connection, but in case of ending tenancy, this purges the central connection, resulting in DatabaseStorageDriver::$centralDatabase->getPdo() returning null, making it unable to delete tenants after tenancy was ended (such as in tests' tearDown()).

TODO:

  • Regression test

@stancl stancl added the bug Something isn't working label Oct 19, 2019
@stancl stancl added this to the 2.1.1 milestone Oct 19, 2019
@stancl stancl self-assigned this Oct 19, 2019
@codecov
Copy link

codecov bot commented Oct 19, 2019

Codecov Report

Merging #189 into 2.x will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##                2.x    #189      +/-   ##
===========================================
+ Coverage     89.06%   89.1%   +0.03%     
- Complexity      315     316       +1     
===========================================
  Files            52      52              
  Lines           924     927       +3     
===========================================
+ Hits            823     826       +3     
  Misses          101     101
Impacted Files Coverage Δ Complexity Δ
src/DatabaseManager.php 94.11% <100%> (+0.36%) 20 <1> (+1) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c8a0a58...616b485. Read the comment docs.

@stancl stancl marked this pull request as ready for review October 19, 2019 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TDD Setup and Tear Down Creates a new DB each time tests run
1 participant