This page lists Ink's domain tables. All tables live in your
own Supabase project. RLS is enabled on every table.
profiles — user metadata.
workspaces — tenant boundary.
workspace_members — user ↔ workspace with role.
Ink domain tables
spaces
| Column | Type | Notes |
|---|
id | uuid PK | |
workspace_id | uuid FK → workspaces | |
name | text | |
slug | text | URL slug. |
icon | text | Emoji or storage path. |
visibility | text | private, workspace, public. |
default_role | text | Role applied when visibility = workspace. |
is_archived | bool | |
created_by | uuid FK → auth.users | |
space_members
| Column | Type | Notes |
|---|
space_id | uuid FK → spaces | |
user_id | uuid FK → auth.users | |
role | text | admin, editor, commenter, viewer. |
pages
| Column | Type | Notes |
|---|
id | uuid PK | |
workspace_id | uuid FK → workspaces | |
space_id | uuid FK → spaces | |
parent_page_id | uuid FK → pages | Null for root-level pages. |
title | text | |
slug | text | URL slug within space. |
position | int | Sibling ordering. |
icon | text | |
published | bool | |
published_slug | text | Public URL slug. |
published_meta | jsonb | SEO metadata. |
is_archived | bool | |
created_by | uuid FK → auth.users | |
updated_at | timestamptz | |
blocks
| Column | Type | Notes |
|---|
id | uuid PK | |
page_id | uuid FK → pages | |
parent_block_id | uuid FK → blocks | Null for root-level blocks. |
position | numeric | Fractional positioning for conflict-free reordering. |
type | text | paragraph, heading, code, table, toggle, ... |
data | jsonb | Type-specific payload. |
created_at | timestamptz | |
updated_at | timestamptz | |
page_versions
Version history for pages.
| Column | Type | Notes |
|---|
id | uuid PK | |
page_id | uuid FK → pages | |
snapshot | jsonb | Full block tree at that point in time. |
author_id | uuid FK → auth.users | |
created_at | timestamptz | |
Pruned nightly by ink-version-pruner beyond the retention
window.
| Column | Type | Notes |
|---|
id | uuid PK | |
workspace_id | uuid FK → workspaces | |
name | text | Normalized lowercase. |
color | text | Hex. |
group_id | uuid FK → tag_groups | Nullable. |
is_reserved | bool | |
tag_groups
| Column | Type | Notes |
|---|
id | uuid PK | |
workspace_id | uuid FK → workspaces | |
name | text | |
page_tags
Join table.
| Column | Type | Notes |
|---|
page_id | uuid FK → pages | |
tag_id | uuid FK → tags | |
| Column | Type | Notes |
|---|
id | uuid PK | |
page_id | uuid FK → pages | |
parent_id | uuid FK → comments | Null for top-level. |
author_id | uuid FK → auth.users | |
body | text | Markdown. |
resolved | bool | |
resolved_by | uuid FK → auth.users | |
resolved_at | timestamptz | |
created_at | timestamptz | |
| Column | Type | Notes |
|---|
comment_id | uuid FK → comments | |
block_id | uuid FK → blocks | Nullable. |
selection | jsonb | Text range within the block. |
share_links
| Column | Type | Notes |
|---|
id | uuid PK | |
page_id | uuid FK → pages | |
token | text | Random id used in URL. |
role | text | viewer, commenter, editor. |
expires_at | timestamptz | |
password_hash | text | Null if no password. |
require_email | bool | |
created_by | uuid FK → auth.users | |
revoked_at | timestamptz | Null if active. |
share_link_visits
Audit log for external share-link access.
page_links
Bidirectional link graph between pages (populated by a trigger
when a page body references another page).
| Column | Type | Notes |
|---|
source_page_id | uuid FK → pages | |
target_page_id | uuid FK → pages | |
uploads
Metadata for Supabase Storage objects.
| Column | Type | Notes |
|---|
id | uuid PK | |
workspace_id | uuid FK → workspaces | |
bucket | text | |
object_key | text | Storage path. |
mime_type | text | |
size_bytes | bigint | |
uploaded_by | uuid FK → auth.users | |
uploaded_at | timestamptz | |
search_index
Materialized tsvector + trigram fallback covering every block's
text content.
Relationships at a glance
workspaces
└─ spaces
├─ space_members
└─ pages
├─ blocks (tree via parent_block_id)
├─ page_versions
├─ comments ─ comment_anchors ─ blocks
├─ share_links ─ share_link_visits
├─ page_tags ─ tags (optional: tag_groups)
└─ page_links (graph)
uploads (workspace-scoped, referenced by block `data`)
RLS summary
spaces: visible if space_members row exists, or if
visibility = workspace and the user is a workspace member,
or if visibility = public.
pages: inherits from space + per-page override tables (not
shown here for brevity; see the SQL).
blocks, page_versions, comments, comment_anchors:
visible if the parent page is visible.
share_links, share_link_visits: readable by the link's
creator and admins.
uploads: readable if the referencing page is readable.
- Edge Functions use the service-role client for version pruning
and publish rendering.