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] Migrate fresh #148

Merged
merged 8 commits into from
Sep 30, 2019
Merged

[2.x] Migrate fresh #148

merged 8 commits into from
Sep 30, 2019

Conversation

stancl
Copy link
Member

@stancl stancl commented Sep 29, 2019

Alternative implementation of #128

I think delegating the migration logic to tenants:migrate is better than extending the MigrateCommand, when it's not really a migrate command. Kind of a composition over inheritance thing. Also this means that we don't have to register the command in the service provider, as it does not depend on Migrator.

Also used $tenant->getDatabaseConnection() instead of hard-coded 'tenant', since tenants can use a different DB connection. And used the tenants namespace instead of tenancy.

ping @drbyte

TODO:

@stancl stancl added this to the 2.0.0 milestone Sep 29, 2019
@stancl stancl self-assigned this Sep 29, 2019
@codecov
Copy link

codecov bot commented Sep 29, 2019

Codecov Report

Merging #148 into 2.x will increase coverage by 0.46%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##                2.x     #148      +/-   ##
============================================
+ Coverage     89.06%   89.53%   +0.46%     
- Complexity      271      274       +3     
============================================
  Files            46       47       +1     
  Lines           805      822      +17     
============================================
+ Hits            717      736      +19     
+ Misses           88       86       -2
Impacted Files Coverage Δ Complexity Δ
src/TenancyServiceProvider.php 94.87% <ø> (ø) 4 <0> (ø) ⬇️
src/Commands/Migrate.php 94.11% <ø> (ø) 4 <0> (ø) ⬇️
src/Commands/MigrateFresh.php 100% <100%> (ø) 3 <3> (?)
src/TenantManager.php 100% <0%> (+2.17%) 32% <0%> (ø) ⬇️

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 cdf174c...f7c4450. Read the comment docs.

@stancl stancl merged commit d0b1729 into 2.x Sep 30, 2019
@stancl stancl deleted the migrate-fresh branch September 30, 2019 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant