You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Cannot delete a site that has QR codes #248
Deleting a site fails when the site has one or more QR codes because the cleanup routine violates a QR-code foreign key constraint.
Environment
Product/Service: HitKeep dashboard — site administration
Region/Version: Self-hosted/current development version
Browser/OS: Not browser-specific
Reproduction Steps
Create a site.
Create a QR campaign and QR code for that site.
Attempt to delete the site from site settings.
Observe that the deletion fails.
Expected Behavior
The site and all site-scoped QR campaign data are deleted successfully.
Actual Behavior
The site deletion fails while updating or removing the site's QR-code relationships. The QR code is still referenced by another QR-related table, so DuckDB rejects the operation.
Error Details
could not update site foreign key qr_codes.site_id: Constraint Error:
Violates foreign key constraint because key "qr_code_id: [QR_CODE_ID]"
is still referenced by a foreign key in a different table.
Visual Evidence
Not applicable; the backend constraint error is sufficient to reproduce the failure.
Impact
Medium — Sites containing QR codes cannot be deleted through the supported workflow.
Release Notes
Fixed site deletion failing for sites that contain QR codes.
Docs Impact
Not needed.
Additional Context
The same foreign-key ordering problem can also surface when renaming a site's domain because both operations use shared site cleanup/transfer routines. DuckDB does not support cascading deletes or deferred constraints, so dependent QR rows must be handled before rewriting or deleting the parent QR-code rows.
Activity