Files
gstack/supabase/migrations/005_sync_heartbeats.sql
Garry Tan 87cb769c35 feat: sync heartbeats, eval:trend --team, setup guide, 10 new tests
- 005_sync_heartbeats.sql migration for connectivity testing
- eval:trend --team flag pulls team eval data (graceful fallback)
- docs/TEAM_SYNC_SETUP.md step-by-step setup guide
- Design doc status updated to Phase 2 complete
- 10 new tests for sync show formatting functions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 19:43:03 -05:00

26 lines
824 B
SQL

-- 005_sync_heartbeats.sql — Lightweight table for sync connectivity tests.
--
-- Used by `gstack-sync test` to validate the full push/pull flow
-- without polluting real data tables.
create table if not exists sync_heartbeats (
id uuid primary key default gen_random_uuid(),
team_id uuid references teams(id) not null,
user_id uuid references auth.users(id),
hostname text not null default '',
timestamp timestamptz not null default now()
);
-- RLS
alter table sync_heartbeats enable row level security;
create policy "team_insert" on sync_heartbeats
for insert with check (
team_id in (select team_id from team_members where user_id = auth.uid())
);
create policy "team_read" on sync_heartbeats
for select using (
team_id in (select team_id from team_members where user_id = auth.uid())
);