Files
acmcc/supabase/migrations/20260608001000_amenities_source_rv_lot_id.sql
T
admin 69f643a51e RV/Boat Lots: sync lots to public rental_calendar amenities
Add a "Sync to Public Page" button that creates/updates one rental_calendar
amenity per lot (name, size · rate · availability in the description, rate in
booking_config, shown on the public page). Idempotent via amenities.source_rv_lot_id;
removes synced amenities for deleted lots.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-07 21:06:21 -04:00

5 lines
317 B
SQL

-- Link a synced public amenity back to its RV/Boat lot so re-syncing updates
-- (rather than duplicates) the per-lot rental_calendar amenity.
alter table public.amenities add column if not exists source_rv_lot_id uuid;
create index if not exists idx_amenities_source_rv_lot_id on public.amenities(source_rv_lot_id);