fix(upgrade): drop morph indexes before columns and baseline 000071 - #2713
Open
wychoong wants to merge 6 commits into
Open
fix(upgrade): drop morph indexes before columns and baseline 000071#2713wychoong wants to merge 6 commits into
wychoong wants to merge 6 commits into
Conversation
MariaDB and SQLite refuse DROP COLUMN while the v1 attribute morph indexes remain. The product-types tax-class FK is already created by the upgrade data step, so 000071 belongs in v2_baseline like 000059. Co-authored-by: Cursor <cursoragent@cursor.com>
Schema::hasIndex(..., 'index') misses SQLite, which reports btree. Core-only v1 never created staff, but v2 still marked create_staff as run, so later core staff migrations altered a missing table. Co-authored-by: Cursor <cursoragent@cursor.com>
wychoong
commented
Sep 3, 2026
|
|
||
| return Schema::connection($connection)->hasTable( | ||
| config('lunar.database.table_prefix').'staff', | ||
| ); |
Contributor
Author
There was a problem hiding this comment.
in v1 staff is in panel package, so there is a chance someone using lunarphp for core without panel
wychoong
commented
Sep 3, 2026
|
|
||
| /** | ||
| * Drop a v1 index by its live name. `Schema::hasIndex(..., 'index')` misses | ||
| * SQLite, which reports the type as `btree` rather than `index`. |
Contributor
Author
There was a problem hiding this comment.
seems a few more sqlite specific issue, not sure worth handling for upgrade command as unlikely anyone using it for prod
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.
Stacked on #2712.
The new upgrade-path workflow currently fails on every driver. This PR is the package-side fix so that workflow can go green.
Attribute morph indexes
v1 indexes
attribute_groups.attributable_typeandattributes.attribute_type(plus unique(attribute_type, handle)).2026_06_01_000003drops those columns without dropping the indexes first.DROP COLUMNfails while the index remainsKey column doesn't exist in table)Drop the indexes (when present) immediately before
dropColumn.Product-types tax-class FK
2026_06_01_000011addsproduct_types.default_tax_class_idand its foreign key. Core2026_01_01_000071only adds the constraint, for fresh installs whose create migration cannot referencetax_classesyet.000071is missing fromledger.v2_baseline, so after ledger-rewritephp artisan migrateruns it again and MySQL/Postgres error on a duplicate FK. Same treatment000059already gets. This is the one-line change from #2605.Test plan
lunarphp/core1.5.0 appMade with Cursor