CREATE TABLE IF NOT EXISTS driver_assignments (
    id SERIAL PRIMARY KEY,
    order_id INT NOT NULL,
    driver_id INT NOT NULL,
    assignment_status VARCHAR(50) NOT NULL DEFAULT 'pending', -- pending, accepted, completed
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    FOREIGN KEY (order_id) REFERENCES orders(id) ON DELETE CASCADE,
    FOREIGN KEY (driver_id) REFERENCES drivers(id) ON DELETE CASCADE
);
