mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
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:
co-authored by
Claude Opus 4.7
parent
7e25b4fad9
commit
efc72272e1
@@ -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
@@ -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++;
|
||||
|
||||
Reference in New Issue
Block a user