* MED-151: add profile view and working smoking dashboard card * update zod * move some components to shared * move some components to shared * remove console.logs * remove unused password form components * only check null for variant * use pathsconfig
44 lines
963 B
SQL
44 lines
963 B
SQL
ALTER TABLE medreport.account_params
|
|
ADD is_smoker boolean;
|
|
|
|
|
|
CREATE UNIQUE INDEX params_account_id_pkey ON medreport.account_params USING btree (account_id);
|
|
alter table medreport.account_params add constraint "params_account_id_pkey" UNIQUE using index "params_account_id_pkey";
|
|
|
|
alter policy "users can insert their params"
|
|
on "medreport"."account_params"
|
|
to authenticated
|
|
with check (
|
|
account_id in (
|
|
select id
|
|
from medreport.accounts
|
|
where primary_owner_user_id = auth.uid()
|
|
)
|
|
);
|
|
|
|
alter policy "users can read their params"
|
|
on "medreport"."account_params"
|
|
to authenticated
|
|
using (
|
|
account_id in (
|
|
select id
|
|
from medreport.accounts
|
|
where primary_owner_user_id = auth.uid()
|
|
)
|
|
);
|
|
|
|
create policy "users can update their params"
|
|
on "medreport"."account_params"
|
|
as PERMISSIVE
|
|
for UPDATE
|
|
to authenticated
|
|
using (
|
|
account_id in (
|
|
select id
|
|
from medreport.accounts
|
|
where primary_owner_user_id = auth.uid()
|
|
)
|
|
);
|
|
|
|
|