Repository navigation
release/v1.6.73 - #318
Merged
Merged
release/v1.6.73#318
Conversation
…E DATABASE Setting::doesntHaveConnection() opens the mysql connection with the configured schema selected while the app boots. Clearing the schema name in config doesn't touch that cached connection, so CREATE DATABASE failed with Unknown database on a fresh install. Purge before each statement and after restoring the schema, and purge in Setting::hasConnection() when the check fails. Release v1.6.73.
1 task
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #318 +/- ##
===========================================
Coverage 100.00% 100.00%
Complexity 8935 8935
===========================================
Files 473 473
Lines 28064 28067 +3
===========================================
+ Hits 28064 28067 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mysql:createdbworks on a fresh install againmysql:createdbfailed with "Unknown database" on a fresh install.Cause:
CoreServiceProvider::scheduleCommands()callsSetting::doesntHaveConnection()while every command boots. That opens themysqlconnection with the configured schema selected, and Laravel caches it. The command then set the schema name tonullin config, but the cached connection never saw that change. SoCREATE DATABASEran on a connection pointing at the very database it was meant to create.Fix:
CreateDatabasenow callsDB::purge('mysql')before eachCREATE DATABASE, and again after restoring the schema name, so later code reconnects with the right schema.Setting::hasConnection()callsDB::purge()when its check fails, so a broken connection isn't left cached for other code.Tests:
DatabaseCommandsTestDB fake gainspurge(), plus a test asserting the purge → statement → purge order.SettingModelTestfake gainspurge(), and the test asserts the failure path purges.Also bumps
composer.jsonto 1.6.73 and replacesRELEASE.md.After this is tagged, the API can move to 1.6.73. Deployments that override
CreateDatabaseinapi/app/Console/Commandscan then drop the override and itsAppServiceProviderbinding.🤖 Generated with Claude Code