create table if not exists public.reader_sync_state (
user_id uuid primary key references auth.users(id) on delete cascade,
payload jsonb not null default '{}'::jsonb,
updated_at timestamptz not null default now()
);
alter table public.reader_sync_state enable row level security;
create policy "own reader state" on public.reader_sync_state
for all using (auth.uid() = user_id) with check (auth.uid() = user_id);