mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 06:51:13 -05:00
Fix settings validation and session errors
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
-- Backfill missing privacy settings fields for existing users
|
||||
UPDATE user_preferences
|
||||
SET privacy_settings = privacy_settings || jsonb_build_object(
|
||||
'show_avatar', COALESCE((privacy_settings->>'show_avatar')::boolean, true),
|
||||
'show_bio', COALESCE((privacy_settings->>'show_bio')::boolean, true),
|
||||
'show_activity_stats', COALESCE((privacy_settings->>'show_activity_stats')::boolean, true),
|
||||
'show_home_park', COALESCE((privacy_settings->>'show_home_park')::boolean, false)
|
||||
)
|
||||
WHERE
|
||||
privacy_settings IS NOT NULL
|
||||
AND (
|
||||
privacy_settings->>'show_avatar' IS NULL OR
|
||||
privacy_settings->>'show_bio' IS NULL OR
|
||||
privacy_settings->>'show_activity_stats' IS NULL OR
|
||||
privacy_settings->>'show_home_park' IS NULL
|
||||
);
|
||||
Reference in New Issue
Block a user