Skip to content

migrate:clean bakery command#1007

Merged
lcharette merged 4 commits intouserfrosting:hotfixfrom
amosfolz:hotfix-migrate-clean-bakeryCommand
Jul 6, 2019
Merged

migrate:clean bakery command#1007
lcharette merged 4 commits intouserfrosting:hotfixfrom
amosfolz:hotfix-migrate-clean-bakeryCommand

Conversation

@amosfolz
Copy link
Copy Markdown
Contributor

@amosfolz amosfolz commented Jul 2, 2019

This command removes stale migrations from the database. These missing migration classes prevent other migrate:* commands from running until the missing class files are either added back to the file system or manually dropped from the migrations table.

I also added a note about the new command when "Unable to find migration..." error messages are given in two of the Migrator classes.

Issue #1002

amosfolz and others added 2 commits July 2, 2019 22:59
Also updated messages in Migrator classes that command can be run to remove stale migrations.
@amosfolz
Copy link
Copy Markdown
Contributor Author

amosfolz commented Jul 4, 2019

It looks like the 5.6 builds are failing

@lcharette
Copy link
Copy Markdown
Member

Looks good. I'll test the actual command when I get the chance, but it could be quite useful in development. Might just add a help part where you explain what a stale migration is and why it can be dangerous to removed them (failed dependencies). A force option could be useful in this case to by-pass the confirmation.

Add help, add -f option to bypass confirmation prompt
@amosfolz
Copy link
Copy Markdown
Contributor Author

amosfolz commented Jul 4, 2019

Looks good. I'll test the actual command when I get the chance, but it could be quite useful in development. Might just add a help part where you explain what a stale migration is and why it can be dangerous to removed them (failed dependencies). A force option could be useful in this case to by-pass the confirmation.

Added help message and force option in recent commit.

@lcharette lcharette added this to the 4.2.x milestone Jul 6, 2019
@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 6, 2019

Codecov Report

Merging #1007 into hotfix will decrease coverage by 0.33%.
The diff coverage is 2.63%.

Impacted file tree graph

@@             Coverage Diff              @@
##             hotfix    #1007      +/-   ##
============================================
- Coverage      68.3%   67.97%   -0.34%     
- Complexity     2141     2151      +10     
============================================
  Files           159      160       +1     
  Lines          7289     7325      +36     
============================================
  Hits           4979     4979              
- Misses         2310     2346      +36
Impacted Files Coverage Δ Complexity Δ
.../sprinkles/core/src/Bakery/MigrateCleanCommand.php 0% <0%> (ø) 10 <10> (?)
.../sprinkles/core/src/Database/Migrator/Migrator.php 93.24% <0%> (ø) 56 <0> (ø) ⬇️
.../Database/Migrator/MigrationDependencyAnalyser.php 94.23% <100%> (ø) 24 <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 21e43db...7ba71a4. Read the comment docs.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 6, 2019

Codecov Report

Merging #1007 into hotfix will decrease coverage by 1.57%.
The diff coverage is 2.63%.

Impacted file tree graph

@@             Coverage Diff              @@
##             hotfix    #1007      +/-   ##
============================================
- Coverage      68.3%   66.73%   -1.58%     
+ Complexity     2141     2088      -53     
============================================
  Files           159      160       +1     
  Lines          7283     6861     -422     
============================================
- Hits           4975     4579     -396     
+ Misses         2308     2282      -26
Impacted Files Coverage Δ Complexity Δ
.../sprinkles/core/src/Bakery/MigrateCleanCommand.php 0% <0%> (ø) 10 <10> (?)
.../sprinkles/core/src/Database/Migrator/Migrator.php 93.1% <0%> (+1.21%) 52 <0> (-4) ⬇️
.../Database/Migrator/MigrationDependencyAnalyser.php 94.23% <100%> (ø) 24 <0> (ø) ⬇️
app/sprinkles/core/src/Util/EnvironmentInfo.php 43.75% <0%> (-12.5%) 5% <0%> (ø)
app/sprinkles/core/src/Util/RawAssetBundles.php 47.22% <0%> (-6.84%) 17% <0%> (ø)
app/sprinkles/admin/src/Sprunje/UserSprunje.php 20.4% <0%> (-6.01%) 24% <0%> (ø)
...pp/sprinkles/account/src/Twig/AccountExtension.php 89.47% <0%> (-5.99%) 6% <0%> (-1%)
app/sprinkles/core/src/Twig/CoreExtension.php 83.87% <0%> (-3.63%) 8% <0%> (-3%)
...prinkles/core/src/Bakery/MigrateRefreshCommand.php 65.62% <0%> (-3.13%) 8% <0%> (ø)
app/sprinkles/core/src/Bakery/MigrateCommand.php 69.04% <0%> (-3.05%) 12% <0%> (ø)
... and 51 more

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 21e43db...7ba71a4. Read the comment docs.

@lcharette lcharette merged commit 3516f98 into userfrosting:hotfix Jul 6, 2019
@amosfolz amosfolz deleted the hotfix-migrate-clean-bakeryCommand branch July 6, 2019 20:43
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.

2 participants