38980-vm/app-9w9pd00g5j41/supabase/migrations/00037_add_trip_start_location_fields.sql
2026-03-04 18:25:09 +00:00

20 lines
874 B
SQL
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- Seyahat başlangıç noktası alanlarını ekle
ALTER TABLE trips
ADD COLUMN IF NOT EXISTS start_location_name TEXT,
ADD COLUMN IF NOT EXISTS start_lat DOUBLE PRECISION,
ADD COLUMN IF NOT EXISTS start_lng DOUBLE PRECISION;
-- start_location_type için CHECK constraint güncelle (eğer yoksa ekle)
DO $$
BEGIN
-- Önce mevcut constraint'i kaldır (varsa)
ALTER TABLE trips DROP CONSTRAINT IF EXISTS trips_start_location_type_check;
-- Yeni constraint ekle
ALTER TABLE trips ADD CONSTRAINT trips_start_location_type_check
CHECK (start_location_type IN ('balloon', 'hotel', 'custom', 'place', 'city_center'));
END $$;
COMMENT ON COLUMN trips.start_location_name IS 'Başlangıç noktası adı (otel adı, adres vb.)';
COMMENT ON COLUMN trips.start_lat IS 'Başlangıç noktası enlem';
COMMENT ON COLUMN trips.start_lng IS 'Başlangıç noktası boylam';