Skip to content
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

Status Checks - Add alert for bad foreign key #25437

Merged
merged 1 commit into from
Jan 26, 2023

Conversation

totten
Copy link
Member

@totten totten commented Jan 26, 2023

Overview

Followup to #25380. If one disregards the upgrade notice, then the status-check should remind you.

Before

No status check.

After

Screenshot from 2023-01-25 21-47-20

The "Schema Error" appears if original_id has the ON DELETE CASCADE rule. What this means:

  • It shows warning when you first extract new codebase -- before upgrading DB. (The screenshot shows this situation.)
  • If you have small# activities, then the upgrader cleans the constraint. The warning goes away.
  • If you have large# activities, then the upgrader leaves the constraint. The warning stays.
  • If you drop the constraint (or didn't have it to begin with), then it shows no warning.

(I did r-run those scenarios on MySQL 5.7.)

Technical Details

According to https://stackoverflow.com/questions/12734331/constraint-detail-from-information-schema-on-update-cascade-on-delete-restrict, this metadata should be available in MySQL 5.1+.

@civibot
Copy link

civibot bot commented Jan 26, 2023

(Standard links)

@totten
Copy link
Member Author

totten commented Jan 26, 2023

test-1 barfed. Fired separate run for that job: https://test.civicrm.org/job/CiviCRM-Manual-Test/33/

@totten
Copy link
Member Author

totten commented Jan 26, 2023

Re-run passed.

@totten totten merged commit d672a77 into civicrm:5.58 Jan 26, 2023
@totten totten deleted the 5.58-status-constraint branch January 26, 2023 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants