Add Schema::ensureVectorExtensionExists() to check Atlas Search availability

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • PHP Drivers
    • None
    • None
    • None
    • None
    • None
    • None

      Laravel 13.x introduces Schema::ensureVectorExtensionExists() to verify that the vector extension is available before creating vector columns/indexes (PostgreSQL: checks pgvector). For MongoDB, the equivalent is to check that Atlas Search is available on the current connection.

      Proposed implementation:

      The method should attempt a lightweight Atlas Search operation (e.g. listSearchIndexes) and throw a descriptive exception if Atlas Search is not supported, reusing the existing Builder::isAtlasSearchNotSupportedException() logic.

      // Throws if Atlas Search is not available \(not an Atlas cluster\)
      Schema::ensureVectorExtensionExists\(\);
      
      Schema::create\('collection', function \(Blueprint $collection\) {
          $collection\->vectorIndex\(\[...\], 'my\_vector\_index'\);
      }\);
      

      Reference: https://laravel.com/docs/13.x/migrations#column-method-vector

            Assignee:
            Unassigned
            Reporter:
            Jérôme Tamarelle
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: