diff --git a/.env b/.env index 8840493591..ae218308c4 100644 --- a/.env +++ b/.env @@ -44,9 +44,9 @@ _APP_DB_ADAPTER=sqlite _APP_DB_HOST=mongodb _APP_DB_PORT=0 _APP_DB_SCHEMA=appwrite -_APP_DB_USER= -_APP_DB_PASS= -_APP_DB_ROOT_PASS= +_APP_DB_USER=user +_APP_DB_PASS=password +_APP_DB_ROOT_PASS=rootsecretpassword _APP_DB_SQLITE_PATH=/storage/sqlite/appwrite.db _APP_DB_ADAPTER_DOCUMENTSDB=mongodb _APP_DB_HOST_DOCUMENTSDB=mongodb diff --git a/app/http.php b/app/http.php index b72f3b7f34..b867e7218f 100644 --- a/app/http.php +++ b/app/http.php @@ -267,13 +267,20 @@ function createDatabase(Http $app, string $resourceKey, string $dbName, array $c 'format' => $attr['format'] ?? '' ]), $collection['attributes']); - $indexes = array_map(fn ($index) => new Document([ - '$id' => ID::custom($index['$id']), - 'type' => $index['type'], - 'attributes' => $index['attributes'], - 'lengths' => $index['lengths'], - 'orders' => $index['orders'], - ]), $collection['indexes']); + $supportsFulltext = $database->getAdapter()->getSupportForFulltextIndex(); + $indexes = []; + foreach ($collection['indexes'] as $index) { + if ($index['type'] === Database::INDEX_FULLTEXT && !$supportsFulltext) { + continue; + } + $indexes[] = new Document([ + '$id' => ID::custom($index['$id']), + 'type' => $index['type'], + 'attributes' => $index['attributes'], + 'lengths' => $index['lengths'], + 'orders' => $index['orders'], + ]); + } $database->createCollection($key, $attributes, $indexes); $collectionsCreated++;