Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
-- Migration date: 2026-08-01

-- Support one tabular-review row per project folder, with multiple source documents.
alter table public.tabular_reviews
add column if not exists document_grouping text not null default 'document'
Expand Down Expand Up @@ -42,7 +44,12 @@ select distinct on (cell.review_id, cell.document_id)
coalesce(document.filename, 'Untitled document'),
'document',
cell.document_id,
row_number() over (partition by cell.review_id order by cell.document_id) - 1
-- Order legacy rows by filename (matching the create path, which sorts rows
-- by label) rather than by opaque document_id; document_id breaks ties.
row_number() over (
partition by cell.review_id
order by coalesce(document.filename, 'Untitled document'), cell.document_id
) - 1
from public.tabular_cells cell
join public.documents document on document.id = cell.document_id
where cell.row_id is null
Expand Down
1 change: 1 addition & 0 deletions backend/src/__tests__/integration/stack.supabase.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const PUBLIC_TABLES = [
"document_versions", "documents", "hidden_workflows", "library_folders",
"project_subfolders", "projects", "tabular_cells",
"tabular_review_chat_messages", "tabular_review_chats", "tabular_reviews",
"tabular_review_rows", "tabular_review_row_sources",
"user_api_keys", "user_mcp_connector_tools", "user_mcp_connectors",
"user_mcp_oauth_states", "user_mcp_oauth_tokens",
"user_mcp_tool_audit_logs", "user_profiles",
Expand Down
Loading