Skip to content

fix(migrations): close database connection after command execution#323

Merged
usernane merged 2 commits into
devfrom
feat/recursive-migration-discovery
May 11, 2026
Merged

fix(migrations): close database connection after command execution#323
usernane merged 2 commits into
devfrom
feat/recursive-migration-discovery

Conversation

@usernane
Copy link
Copy Markdown
Member

No description provided.

Ibrahim BinAlshikh added 2 commits May 11, 2026 11:22
Add finally block to all migration commands to release the SchemaRunner's
database connection after execution. This prevents connection leaks when
running multiple commands in sequence (e.g., in test suites).
Test helper methods (initMigrations, dropSchemaTable) also create
SchemaRunner instances that hold connections. Resetting the pool
after each test ensures all connections are closed regardless of
where they were created.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

❌ Patch coverage is 86.78161% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.94%. Comparing base (b855c18) to head (cb813cb).
⚠️ Report is 2 commits behind head on dev.

Files with missing lines Patch % Lines
...amework/Cli/Commands/RollbackMigrationsCommand.php 83.92% 9 Missing ⚠️
...Framework/Cli/Commands/DryRunMigrationsCommand.php 85.71% 8 Missing ⚠️
...Framework/Cli/Commands/MigrationsStatusCommand.php 89.09% 6 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                dev     #323      +/-   ##
============================================
+ Coverage     74.88%   74.94%   +0.06%     
- Complexity     2986     2992       +6     
============================================
  Files            97       97              
  Lines          9551     9564      +13     
============================================
+ Hits           7152     7168      +16     
+ Misses         2399     2396       -3     
Flag Coverage Δ
php-8.3 74.94% <86.78%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@usernane usernane merged commit e8b78a8 into dev May 11, 2026
4 checks passed
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