-- Final cleanup script to remove duplicate constraints and beach_place_uuid column
-- Drop the old-named foreign key constraints that are now duplicates
ALTER TABLE beach_place_terrains DROP CONSTRAINT IF EXISTS beach_place_terrains_beach_place_uuid_fk_fkey;
ALTER TABLE beach_places_photos DROP CONSTRAINT IF EXISTS beach_places_photos_beach_place_uuid_fk_fkey;
ALTER TABLE beach_places_schedules DROP CONSTRAINT IF EXISTS beach_places_schedules_beach_place_uuid_fk_fkey;

-- Now drop the unique constraint for beach_place_uuid (should work now that dependent constraints are gone)
ALTER TABLE beach_places DROP CONSTRAINT IF EXISTS beach_places_beach_place_uuid_key;

-- Finally, drop the redundant beach_place_uuid column from beach_places table
ALTER TABLE beach_places DROP COLUMN IF EXISTS beach_place_uuid;