feat: customize public profile visibility
Some checks failed
CI / build-and-test (pull_request) Has been cancelled
Some checks failed
CI / build-and-test (pull_request) Has been cancelled
This commit is contained in:
12
backend/migrations/006_profile_usernames_and_visibility.sql
Normal file
12
backend/migrations/006_profile_usernames_and_visibility.sql
Normal file
@@ -0,0 +1,12 @@
|
||||
ALTER TABLE users ADD COLUMN IF NOT EXISTS profile_username TEXT;
|
||||
ALTER TABLE users ADD COLUMN IF NOT EXISTS is_future_races_public BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
ALTER TABLE users ADD COLUMN IF NOT EXISTS is_completed_races_public BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
|
||||
UPDATE users
|
||||
SET is_future_races_public = is_profile_public,
|
||||
is_completed_races_public = is_profile_public
|
||||
WHERE is_profile_public = TRUE;
|
||||
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS users_profile_username_normalized_key
|
||||
ON users (LOWER(profile_username))
|
||||
WHERE profile_username IS NOT NULL;
|
||||
Reference in New Issue
Block a user