CREATE TABLE IF NOT EXISTS fleet_status_service_logs (
    id BINARY(16) PRIMARY KEY,
    fleet_status_id BINARY(16) NOT NULL,
    helicopter_id BINARY(16) NOT NULL,
    inspection_type VARCHAR(16) NOT NULL,
    type VARCHAR(255) NOT NULL,
    due VARCHAR(255) NULL,
    ext VARCHAR(255) NULL,
    serviced_at DATETIME(3) NOT NULL,
    created_at DATETIME(3) NULL,
    created_by BINARY(16) NULL,
    INDEX idx_fleet_status_service_logs_fleet_status_id (fleet_status_id),
    INDEX idx_fleet_status_service_logs_helicopter_id (helicopter_id),
    INDEX idx_fleet_status_service_logs_serviced_at (serviced_at),
    CONSTRAINT chk_fleet_status_service_logs_inspection_type CHECK (inspection_type IN ('A/F','ENG1','ENG2','MAIN1','MAIN2')),
    CONSTRAINT fk_fleet_status_service_logs_fleet_status FOREIGN KEY (fleet_status_id) REFERENCES fleet_statuses(id) ON DELETE CASCADE ON UPDATE CASCADE,
    CONSTRAINT fk_fleet_status_service_logs_helicopter FOREIGN KEY (helicopter_id) REFERENCES helicopters(id)
);
