mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-07 14:06:42 +02:00
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>
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
-- 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())
|
||||
);
|
||||
Reference in New Issue
Block a user