fix: keep DB credentials populated and skip fulltext indexes on adapters that lack support

Two fixes for the SQLite test wiring:

1. .env had emptied _APP_DB_USER/_APP_DB_PASS/_APP_DB_ROOT_PASS, but the
   mongodb/mariadb/postgresql containers still consume those during init
   regardless of which adapter Appwrite uses. Empty values left the
   side-running mongodb (needed for documentsdb) refusing to start, which
   blocked docker compose up --wait for every CI matrix row, including
   MongoDB. Restoring the original test credentials.
2. Bootstrap was unconditionally creating fulltext indexes from collection
   configs. SQLite adapter explicitly returns false for
   getSupportForFulltextIndex(), so it threw on the first such index. Now
   the bootstrap consults the adapter and skips fulltext indexes when not
   supported.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jake Barnby
2026-04-30 00:48:21 +12:00
co-authored by Claude Opus 4.7
parent 7e25b4fad9
commit efc72272e1
2 changed files with 17 additions and 10 deletions
+3 -3
View File
@@ -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
+14 -7
View File
@@ -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++;