-- Add vehicle information to trips table
ALTER TABLE trips 
ADD COLUMN vehicle_plate VARCHAR(20) NOT NULL AFTER user_id,
ADD COLUMN has_passengers BOOLEAN DEFAULT FALSE AFTER vehicle_plate;

-- Create passengers table
CREATE TABLE passengers (
    id INT PRIMARY KEY AUTO_INCREMENT,
    trip_id INT NOT NULL,
    name VARCHAR(100) NOT NULL,
    phone_number VARCHAR(20) NOT NULL,
    has_pass BOOLEAN DEFAULT FALSE,
    company VARCHAR(100),
    appointment_details TEXT,
    authorized_by VARCHAR(100) NOT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    FOREIGN KEY (trip_id) REFERENCES trips(id) ON DELETE CASCADE
); 