Fix foreign key constraint violation during ycom addon uninstall#520
Open
Fix foreign key constraint violation during ycom addon uninstall#520
Conversation
Co-authored-by: alxndr-w <[email protected]>
Copilot
AI
changed the title
[WIP] AddOn ycom konnte aus folgendem Grund nicht deinstalliert werden
Fix foreign key constraint violation during ycom addon uninstall
Aug 4, 2025
Contributor
|
@copilot ohne weitere Aktionen: Behalte in diesem PR ausschließlich die Änderungen in der uninstall.php und entferne alle anderen Änderungen. |
Co-authored-by: alxndr-w <[email protected]>
Contributor
Author
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a foreign key constraint violation that occurs during ycom addon uninstallation by ensuring proper cleanup order and including the missing rex_ycom_user_token table cleanup.
- Adds YForm metadata cleanup for the
rex_ycom_user_tokentable - Includes the missing
rex_ycom_user_tokentable drop operation - Maintains proper dependency order by dropping dependent tables before the parent table
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
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.
This PR fixes a foreign key constraint violation that prevents the ycom addon from being uninstalled properly.
Problem
When attempting to uninstall the ycom addon, users encounter this error:
Root Cause
The auth plugin creates a
rex_ycom_user_tokentable with a foreign key constraint torex_ycom_user:rex_ycom_user_token.user_id→rex_ycom_user.id(CASCADE)rex_ycom_user_session.user_id→rex_ycom_user.id(CASCADE)However, the auth plugin lacks an
uninstall.phpscript, so therex_ycom_user_tokentable is never cleaned up during addon uninstallation. When the main uninstall script tries to droprex_ycom_user, MySQL/MariaDB prevents it due to the existing foreign key constraints.Solution
This fix adds the missing cleanup for the
rex_ycom_user_tokentable to the mainuninstall.phpscript and ensures proper table dropping order:rex_ycom_userandrex_ycom_user_tokentablesrex_ycom_user_sessionandrex_ycom_user_tokenrex_ycom_usertable safelyThe changes are minimal and surgical - only adding the missing table cleanup without modifying any existing logic or removing working code.
Fixes #519.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1/usr/bin/php8.3 -n -c /tmp/XiKpia /usr/bin/composer install --dev(http block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.