create table profiles (
id uuid primary key references auth.users on delete cascade,
name text,
avatar_url text
);
create table games (
id uuid primary key DEFAULT gen_random_uuid(),
organizer_id uuid not null references profiles(id) on delete cascade,
name text
);
create table players (
id uuid primary key DEFAULT gen_random_uuid(),
user_id uuid not null references profiles(id) on delete cascade,
game_id uuid not null references games(id) on delete cascade
);
create table profiles (
id uuid primary key references auth.users on delete cascade,
name text,
avatar_url text
);
create table games (
id uuid primary key DEFAULT gen_random_uuid(),
organizer_id uuid not null references profiles(id) on delete cascade,
name text
);
create table players (
id uuid primary key DEFAULT gen_random_uuid(),
user_id uuid not null references profiles(id) on delete cascade,
game_id uuid not null references games(id) on delete cascade
);