Repository navigation
chore(l12): drop Doctrine schema calls and add a guarded tokens migration - #332
Merged
Merged
Conversation
…tion List tables and indexes through the schema builder, which Laravel 10.37+ and 12 both provide. Replace the removed Schema::getAllTables() fallbacks and alias the DataPurger catalog query, whose lower-case column name fails on MySQL 8. Sanctum 4 stops loading its migrations, so add a create migration that sorts after Sanctum 3's and before fix_personal_access_tokens. It is a no-op where the table exists and on the sandbox database, which has never had it. Set reports.average_execution_time to DOUBLE(8,2) in SQL, since Blueprint::float() stops defaulting to total and places on Laravel 11+.
Open
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.
Prepares core-api for the Laravel 12 upgrade while still running on Laravel 10. The upgrade itself is not in this PR.
Changes
Schema::getAllTables()removed.ForceResetDatabase,InitializeSandboxKeyColumn,ApiCredentialController,DataPurgerandSqlDumpernow list tables throughSchema::getTables(). TheindexExists()helpers in two migrations useSchema::getIndexes().DataPurgercatalog fallback fixed. It now aliasestable_name, because the lower-case column name fails on MySQL 8. Laravel 12 would have reached this path.personal_access_tokensmigration. Sanctum 4 stops loading its own migrations, andfix_personal_access_tokensneeds the table. The new migration sorts after Sanctum 3's and does nothing where the table exists.down()is deliberately empty so a rollback can't delete live tokens.reports.average_execution_timepinned toDOUBLE(8,2)in SQL.Blueprint::float()stops defaulting to total and places on Laravel 11+.Decisions to check
sandbox:migrateonly runs package paths, so sandbox has never had this table, andfix_personal_access_tokensskips it too. The sandboxmigrationstable does gain one row for it.:, so adding it now would give::and move every key. It belongs in the Laravel 12 commit, with a cache flush at cutover.CACHE_PREFIXand theexplode(':')[1]inUtils.phpneed checking at the same time.Schema::getTables()andgetIndexes()need Laravel 10.37, whilecomposer.jsonstill allows^9|^10. The constraint should be tightened in the upgrade.release/v2.0.0, as planned for the upgrade. The next minor from 1.6.74 would be 1.7.0.Verification
Fresh
migrateon MySQL 8.0 and Laravel 10.50, comparingSHOW CREATE TABLEdumps across the live, sandbox and storefront databases:mainvs this branch, with Doctrine: no differences.mainvs this branch, with DBAL hidden, native schema operations and Sanctum's migrations off: onlyCOMMENT '(DC2Type:guid)'on 6 columns. That comment is a Doctrine artifact and can't be restated on Laravel 10 without doubling it.maindatabase: no schema changes, and the new migration is a no-op.reportscolumn change, I re-ran onlyReportExecutionColumnsTest, which loads that migration, and it passes.Not tested:
down()methods, and a real Laravel 12 install. The Laravel 10 simulation can't detect Blueprint signature changes, so the float differences came from a separate Laravel 12 spike.