Adds hair length/type, scalp sensitivities, wet/dry state, desired style, who provides extensions, guest count, and two optional reference photos to the booking form. Photos upload to a new private booking-photos storage bucket; admin can view intake details and signed photo URLs per booking. Claude-Session: https://claude.ai/code/session_01NhxA4npAXAxmCDEJt6kxSH
27 lines
1.3 KiB
SQL
27 lines
1.3 KiB
SQL
-- Mira asked for a few extra intake questions when a client books an
|
|
-- appointment (hair length/type, scalp sensitivities, desired style, who
|
|
-- provides extensions, guest count) plus two optional reference photos.
|
|
alter table public.bookings
|
|
add column hair_length text,
|
|
add column hair_type text,
|
|
add column scalp_sensitivities text not null default '',
|
|
add column hair_state text,
|
|
add column desired_style text not null default '',
|
|
add column extensions_provided_by text,
|
|
add column guest_count integer not null default 0,
|
|
add column current_hair_photo_path text,
|
|
add column inspiration_photo_path text;
|
|
|
|
-- Reference photos are private client photos, not marketing images, so
|
|
-- unlike salon-images this bucket stays private: anyone can upload (booking
|
|
-- is done by anonymous visitors) but only admin can read.
|
|
insert into storage.buckets (id, name, public)
|
|
values ('booking-photos', 'booking-photos', false)
|
|
on conflict (id) do update set public = false;
|
|
|
|
create policy "booking_photos_public_insert" on storage.objects
|
|
for insert with check (bucket_id = 'booking-photos');
|
|
|
|
create policy "booking_photos_admin_read" on storage.objects
|
|
for select using (bucket_id = 'booking-photos' and (select auth.uid()) = '21c90224-e0b2-412e-a431-8e7f097c1cef'::uuid);
|