profile_links
Overview
The profile_links table stores external links that users can display in their HomeRoom. Each link has a title, URL, optional icon, and position ordering.
Schema
-- From 20260130_homeroom_foundation.sql
CREATE TABLE profile_links (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id UUID NOT NULL REFERENCES auth.users(id) ON DELETE CASCADE,
title TEXT NOT NULL,
url TEXT NOT NULL,
icon TEXT,
position INTEGER DEFAULT 0,
created_at TIMESTAMPTZ DEFAULT NOW()
);
Columns
| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
id | uuid | No | gen_random_uuid() | Primary key |
user_id | uuid | No | -- | Link owner |
title | text | No | -- | Link display title |
url | text | No | -- | External URL |
icon | text | Yes | -- | Icon identifier |
position | integer | No | 0 | Display order |
created_at | timestamptz | No | NOW() | Creation timestamp |
RLS Policies
-- SELECT: Anyone can view profile links
CREATE POLICY "Profile links are publicly viewable"
ON profile_links FOR SELECT
USING (true);
-- INSERT/UPDATE/DELETE: Users manage their own links
CREATE POLICY "Users can manage own links"
ON profile_links FOR ALL
USING (auth.uid() = user_id);
Related
- home_room_settings -- Room where links are displayed
- profiles -- Link owner
Last updated: 2026-02-07