mirror of
https://github.com/koel/koel.git
synced 2026-04-25 08:46:00 +03:00
[GH-ISSUE #2046] [Bug]: Cannot drop id during 7.11.0 update #1078
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#1078
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 @Doppelkeks12 on GitHub (Aug 11, 2025).
Original GitHub issue: https://github.com/koel/koel/issues/2046
Originally assigned to: @phanan on GitHub.
Read the Troubleshooting guide.
Reproduction steps
rm -rf app config public/build/assets/* database/wget -qO- https://github.com/koel/koel/releases/download/v7.11.0/koel-v7.11.0.tar.gz | tar -xvzC . --strip-components=1php artisan cache:clearartisan koel:init --no-assetsExpected behavior
Update should run without any errors
Actual behavior
An error is thrown with the log below during the database migration
Logs
Laravel Log:
Next Illuminate\Database\QueryException: SQLSTATE[HY000]: General error: 1829 Cannot drop column 'id': needed in a foreign key constraint 'songs_contributing_artist_id_foreign' of table 'songs' (Connection: mysql, SQL: alter tableartistsdropid) in [...]vendor/laravel/framework/src/Illuminate/Database/Connection.php:825 Stack trace: #0 [...]vendor/laravel/framework/src/Illuminate/Database/Connection.php(779): Illuminate\Database\Connection->runQueryCallback('alter tablear...', Array, Object(Closure)) #1 [...]vendor/laravel/framework/src/Illuminate/Database/Connection.php(560): Illuminate\Database\Connection->run('alter tablear...', Array, Object(Closure)) #2 [...]vendor/laravel/framework/src/Illuminate/Database/Schema/Blueprint.php(118): Illuminate\Database\Connection->statement('alter tablear...') #3 [...]vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php(564): Illuminate\Database\Schema\Blueprint->build(Object(Illuminate\Database\MySqlConnection), Object(Illuminate\Database\Schema\Grammars\MySqlGrammar)) #4 [...]vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php(406): Illuminate\Database\Schema\Builder->build(Object(Illuminate\Database\Schema\Blueprint)) #5 [...]vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(361): Illuminate\Database\Schema\Builder->table('artists', Object(Closure)) #6 [...]database/migrations/2025_07_20_165510_promote_public_ids.php(79): Illuminate\Support\Facades\Facade::__callStatic('table', Array) `Koel version
v7.10.2 Plus Edition to v7.11.0 Plus Edition
How did you install Koel?
Pre-compiled tar/zip archive
Additional information
I'm using mysql
@phanan commented on GitHub (Aug 11, 2025):
Hmm,
contributing_artist_id(and with it, the relationship) should have been removed sometime ago.Can you try restoring the DB backup and deleting both the column and the relationship manually before attempting the migration again?
@Doppelkeks12 commented on GitHub (Aug 11, 2025):
@phanan Yes, thanks. It works by removing both manually. I think I can keep those manual changes without breaking future migrations? I don't know how I got those column. My database isn't older than one year.
@phanan commented on GitHub (Aug 11, 2025):
@Doppelkeks12 Glad it works for you! Yeah, the manual changes can be kept. Migrations are only run once, so the problematic migration won't be executed again.
It's certainly not your fault. Since Koel tries to support several different databases (MySQL/MariaDB, Postgres, and SQLite), making the same migrations work for all of them proves to be very complex, and sometimes hiccups like this happen.