-- Migration to add contact and schedule fields to beach_places table
-- This script adds contact_phone, starttime, endtime, and opendays columns

-- Add new columns to beach_places table
ALTER TABLE beach_places 
ADD COLUMN contact_phone VARCHAR(50),
ADD COLUMN starttime TIME,
ADD COLUMN endtime TIME,
ADD COLUMN opendays VARCHAR(7) DEFAULT '1234567'; -- 1234567 means open every day (Mon-Sun)

-- Add index for better query performance
CREATE INDEX idx_beach_places_opendays ON beach_places(opendays);
CREATE INDEX idx_beach_places_contact_phone ON beach_places(contact_phone);

-- Add comments for clarity
COMMENT ON COLUMN beach_places.contact_phone IS 'Contact phone number for the beach';
COMMENT ON COLUMN beach_places.starttime IS 'Beach opening time';
COMMENT ON COLUMN beach_places.endtime IS 'Beach closing time'; 
COMMENT ON COLUMN beach_places.opendays IS 'Days when beach is open (1234567 = Mon-Sun, e.g. 135 = Mon, Wed, Fri)';