create table "medreport"."connected_online_locations" (
    "id" bigint generated by default as identity not null,
    "sync_id" bigint not null,
    "name" text not null,
    "address" text,
    "clinic_id" bigint not null REFERENCES medreport.connected_online_providers(id),
    "created_at" timestamp with time zone not null default now(),
    "updated_at" timestamp without time zone default now()
);

alter table "medreport"."connected_online_locations" enable row level security;

create policy "service_role_all"
on "medreport"."connected_online_locations"
as permissive
for all
to service_role
using (true);


grant delete on table "medreport"."connected_online_locations" to "service_role";

grant insert on table "medreport"."connected_online_locations" to "service_role";

grant references on table "medreport"."connected_online_locations" to "service_role";

grant select on table "medreport"."connected_online_locations" to "service_role";

grant trigger on table "medreport"."connected_online_locations" to "service_role";

grant truncate on table "medreport"."connected_online_locations" to "service_role";

grant update on table "medreport"."connected_online_locations" to "service_role";

grant select on table "medreport"."connected_online_locations" to "authenticated";


create policy "authenticated_select"
on "medreport"."connected_online_locations"
as permissive
for select
to authenticated
using (true);
