mirror of
https://github.com/koel/koel.git
synced 2026-04-25 16:56:02 +03:00
[GH-ISSUE #1969] [Bug]: MySQL migration issue with 7.6.x #1046
Labels
No labels
Authentication
Dependencies
Documentation
Feature Request
Flac
Help Wanted
Installation/Setup
Integration
Mobile
PR Welcome
Pending Release
Performance
Playlist
S3
Search
Sync
[Pri] Low
[Pri] Normal
[Status] Keep Open
[Status] Needs Author Reply
[Status] Needs Review
[Status] Stale
[Status] Will Implement
[Type] Blessed
[Type] Bug
[Type] Duplicate
[Type] Enhancement
[Type] Help Request
[Type] Question
[Type] Task
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/koel-koel#1046
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @gramakri on GitHub (Jun 24, 2025).
Original GitHub issue: https://github.com/koel/koel/issues/1969
Originally assigned to: @phanan on GitHub.
Read the Troubleshooting guide.
Reproduction steps
/app/code/artisan koel:init --no-assets --no-interaction --no-schedulerExpected behavior
Migration/init should not error
Actual behavior
Migration errors
Logs
Error from the logs:
Koel version
7.6.2
How did you install Koel?
Compiled from source
Additional information
@gramakri commented on GitHub (Jun 24, 2025):
The issue seems to come from
2025_06_12_150202_user-scope_artists_and_albums.php. There the code adds a unique constraint for thenamecolumn at https://github.com/koel/koel/blob/master/database/migrations/2025_06_12_150202_user-scope_artists_and_albums.php#L21The MySQL table schema is like this:
MySQL does not allow indexes (including composite UNIQUE indexes) directly on TEXT/BLOB columns without explicitly specifying a prefix length.
See also https://stackoverflow.com/questions/14033378/make-text-column-as-unique-key
@phanan commented on GitHub (Jun 24, 2025):
Can you try removing the index creation code and see if the migration goes
though? If yes I issue a fix. Interestingly the CI didn’t catch this.
On Tue, Jun 24, 2025 at 12:08 Girish Ramakrishnan @.***>
wrote:
@gramakri commented on GitHub (Jun 24, 2025):
Was debugging this a bit. In
2021_12_06_164648_increase_string_columns_length.php, the name column length changed to 65504 . The default database encoding in Cloudron isutf8mb4. In mysql, VARCHAR is max 65536 bytes and with utf8mb4, VARCHAR can only hold 16384 characters . After this, it will get upped into a TEXT field . This is whynamebecame a MEDIUMTEXT in the first place.@phanan in the CI, do you know the database encoding? What encoding is suggested by koel?
@gramakri commented on GitHub (Jun 24, 2025):
Well, nevermind. It seems in config/database.php , mysql-ci is using utf8mb4 . Hmm...
I tried removing the 'name' as unique key (in both the tables in that migration field). Now that migration succeeds. But we have a new failure
@phanan commented on GitHub (Jun 24, 2025):
That’s understandable, as the change applied to both artists and albums
tables. We can try to apply a length to the TEXT index, or remove the index
altogether.
On Tue, Jun 24, 2025 at 22:20 Girish Ramakrishnan @.***>
wrote:
@phanan commented on GitHub (Jun 25, 2025):
Fixed and released.