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

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • None
    • 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:
              Jérôme Tamarelle
              Reporter:
              Jérôme Tamarelle
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: