-
Notifications
You must be signed in to change notification settings - Fork 37
Fix foreign key constraint violation during ycom addon uninstall #520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: alxndr-w <[email protected]>
@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]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_token
table - Includes the missing
rex_ycom_user_token
table 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 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_token
table 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.php
script, so therex_ycom_user_token
table 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_token
table to the mainuninstall.php
script and ensures proper table dropping order:rex_ycom_user
andrex_ycom_user_token
tablesrex_ycom_user_session
andrex_ycom_user_token
rex_ycom_user
table 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.