diff --git a/backend/handlers/scheduling/time-blockers.go b/backend/handlers/scheduling/time-blockers.go index 1ec1c9a..2bf9107 100644 --- a/backend/handlers/scheduling/time-blockers.go +++ b/backend/handlers/scheduling/time-blockers.go @@ -368,13 +368,17 @@ func CleanupOldReservations(ctx context.Context) error { // Active/pending bookings are excluded so the salon can still contact the guest. func AnonymizeStaleGuestAccounts(ctx context.Context) error { _, err := db.DB.Exec(ctx, ` - UPDATE users SET - n_first_name = 'Guest', - n_last_name = 'Anonymized', - email = 'anon-' || id || '@anon.invalid', - phone = '000000000000', - date_of_birth = '1900-01-01', - updated_at = NOW() + UPDATE users SET + n_first_name = 'Guest', + n_last_name = 'Anonymized', + email = 'anon-' || id || '@anon.invalid', + phone = '000000000000', + date_of_birth = '1900-01-01', + profile_pic_url = NULL, + referral_code = NULL, + notes = NULL, + data_retention_consent = FALSE, + updated_at = NOW() WHERE account_role = 'guest' AND id NOT IN ( SELECT user_id FROM bookings WHERE status IN ('pending', 'confirmed')