-
Notifications
You must be signed in to change notification settings - Fork 3
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
Update Laravel to version 9 #718
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f6487ad
chore(deps): update guzzle to version 7
m90 7829fbd
feat: update dependency tree to use laravel 9
m90 bdf84ee
chore: adjust method signatures to match v9
m90 0a33296
refactor: fake logger API has changed
m90 699793e
fix: get stopped supporting non-scalar return values
m90 b99b912
fix: fix errors raised by psalm
m90 f736e5a
refactor: some models on user class just call through to parent
m90 e8fd5b3
docs: add changelog
m90 1611e07
fix: address review comments
m90 215d517
chore: port relevant changes from laravel/laravel application skeleton
m90 86e370b
docs: update CHANGELOG
m90 File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
use Illuminate\Database\DatabaseManager; | ||
|
||
/** | ||
* Prepends the MW Database, User with `deleted_` prefix and deletes WikiDB relation for a wiki | ||
* Prepends the MW Database, User with `deleted_` prefix and deletes WikiDB relation for a wiki | ||
*/ | ||
class DeleteWikiDbJob extends Job implements ShouldBeUnique | ||
{ | ||
|
@@ -65,15 +65,15 @@ public function handle( DatabaseManager $manager ) | |
if (! $conn instanceof \Illuminate\Database\Connection) { | ||
throw new \RuntimeException('Must be run on a PDO based DB connection'); | ||
} | ||
|
||
$pdo = $conn->getPdo(); | ||
$timestamp = Carbon::now()->timestamp; | ||
$deletedDatabaseName = "mwdb_deleted_{$timestamp}_{$this->wikiId}"; | ||
|
||
if ($pdo->exec('USE '.$wikiDB->name) === false) { | ||
throw new \RuntimeException('Failed to use database with dbname: '.$wikiDB->name); | ||
} | ||
|
||
|
||
$tables = []; | ||
$result = $pdo->query('SHOW TABLES')->fetchAll(); | ||
|
@@ -88,7 +88,7 @@ public function handle( DatabaseManager $manager ) | |
if(count($values) !== 1) { | ||
throw new \RuntimeException("Tried getting table names for wikiDB {$wikiDB->name} but failed"); | ||
} | ||
|
||
$tables[] = $values[0]; | ||
} | ||
|
||
|
@@ -107,6 +107,9 @@ public function handle( DatabaseManager $manager ) | |
$replacedCount = 0; | ||
$tableWithoutPrefix = str_replace($wikiDB->prefix . '_', '', $table, $replacedCount ); | ||
if ($replacedCount !== 1) { | ||
/** | ||
* @psalm-suppress InvalidCast | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I really tried hard to understand these warnings but I could not make any sense of them so I suppressed them for now. If anyone has a hunch why they might show up, please lmk. |
||
*/ | ||
throw new \RuntimeException("Did not find prefix '{$wikiDB->prefix}' in tablename '{$table}' "); | ||
} | ||
$pdo->exec(sprintf('RENAME TABLE %s.%s TO %s.%s', $wikiDB->name, $table, $deletedDatabaseName, $tableWithoutPrefix)); | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was wrong usage before and worked mostly by accident. Now, Symfony will throw an error on the wrong usage, so I was able to fix it.