-- Add soft delete fields for appointments
-- Allows patients and doctors to hide appointments from their view without deleting them for the other party
ALTER TABLE appointments
ADD COLUMN deleted_by_patient BOOLEAN DEFAULT FALSE NOT NULL,
ADD COLUMN deleted_by_doctor BOOLEAN DEFAULT FALSE NOT NULL;

-- Create index for performance when filtering deleted appointments
CREATE INDEX idx_appointments_deleted_by_patient ON appointments(deleted_by_patient);
CREATE INDEX idx_appointments_deleted_by_doctor ON appointments(deleted_by_doctor);

