Özgün çalışan dosya
schema.sql
Kodlardaki adlar ve çalışan örnek sayfalardaki metinler özgün halleriyle korunmuştur. Ders ve dosya açıklamaları bunları Türkçe olarak açıklar.
create table public.profiles (
id uuid primary key references auth.users(id) on delete cascade,
display_name text not null check (char_length(display_name) between 1 and 80)
);
alter table public.profiles enable row level security;
revoke all on public.profiles from anon;
grant select,insert,update on public.profiles to authenticated;
create policy "read own" on public.profiles for select to authenticated using (auth.uid()=id);
create policy "insert own" on public.profiles for insert to authenticated with check (auth.uid()=id);
create policy "update own" on public.profiles for update to authenticated using (auth.uid()=id) with check (auth.uid()=id);