create table if not exists saved_public_items ( id uuid primary key default gen_random_uuid(), source_id text not null, title text not null, category text, address text, source_url text, memo text, owner_id uuid references auth.users(id) on delete cascade, is_public boolean default false, created_at timestamptz default now(), updated_at timestamptz default now() );
alter table saved_public_items enable row level security;
create policy "read own saved items" on saved_public_items for select using (auth.uid() = owner_id);
create policy "insert own saved items" on saved_public_items for insert with check (auth.uid() = owner_id);
create policy "update own saved items" on saved_public_items for update using (auth.uid() = owner_id) with check (auth.uid() = owner_id);
create policy "delete own saved items" on saved_public_items for delete using (auth.uid() = owner_id);