Skip to main content
Skip to - Close
Skip to - Close
Completion requirements

Tablo Oluşturma

Yeni bir migration dosyası aşağıdaki komutla oluşturulur:

npx supabase migration new create_yazilar

Komut, supabase/migrations klasöründe zaman damgalı bir SQL dosyası oluşturur. Bu dosyaya tablo tanımı yazılır:

create table public.yazilar (
  id bigint generated always as identity primary key,
  baslik text not null,
  icerik text,
  yazar_id uuid references auth.users(id) on delete cascade,
  yayinda boolean default false,
  created_at timestamptz default now()
);

Migration dosyası hazırlandıktan sonra uzak veri tabanına aktarılır:

npx supabase db push
Open in new window