-- create a table to hold FCM device tokens for push notifications

create table if not exists public.fcm_tokens (
  id uuid default uuid_generate_v4() primary key,
  user_id uuid references auth.users(id) on delete cascade,
  token text not null,
  created_at timestamptz not null default now()
);

create unique index if not exists fcm_tokens_user_token_idx
  on public.fcm_tokens(user_id, token);
