create table weight_entries (
id bigint generated always as identity primary key,
date date not null unique,
weight numeric not null,
created_at timestamptz default now()
);
create table weight_settings (
id int default 1 primary key,
target_weight numeric,
height numeric,
start_weight numeric
);
insert into weight_settings(id) values(1) on conflict do nothing;
alter table weight_entries enable row level security;
alter table weight_settings enable row level security;
create policy "public" on weight_entries for all using (true) with check (true);
create policy "public" on weight_settings for all using (true) with check (true);