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

Improve error output after a failed FK constraint check #1745

Merged
merged 3 commits into from
Dec 16, 2024

Conversation

peterjan
Copy link
Member

If PRAGMA foreign_key_check fails after running a migration, renterd currently outputs totally useless information. I updated the code to scan for all errors and indicate what FK failed on what table on what row.

Before:

failed to create node: failed to perform migrations: migration X failed: transaction failed (attempt 1): foreign key constraints are not satisfied, err sql: expected 4 destination arguments in Scan, not 0

After:

failed to create node: failed to perform migrations: migration X failed: transaction failed (attempt 1): foreign key constraint violation in table 'slabs': row 2423432, foreign key buffered_slabs

@peterjan peterjan self-assigned this Dec 12, 2024
@ChrisSchinnerl ChrisSchinnerl merged commit c5c89a7 into dev Dec 16, 2024
18 checks passed
@ChrisSchinnerl ChrisSchinnerl deleted the pj/fix-fk-check-output branch December 16, 2024 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants