From 4e5fbea62cf36e2ddfb5bb17953d63c1a27aaf05 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 30 Apr 2026 01:05:54 +1200 Subject: [PATCH] fix: replace Audit::setup() in project create with direct createCollection Same upstream-broken Utopia\Exception in audit's Adapter\Database::setup(). This call site fires every time a project is created, so any test that creates projects (which is almost all of them) crashes when running against SQLite. Mirror the http.php fix: build the audit collection directly through the adapter's schema documents. --- .../Modules/Projects/Http/Projects/Create.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Projects/Http/Projects/Create.php b/src/Appwrite/Platform/Modules/Projects/Http/Projects/Create.php index 363c99dc1f..859b102d53 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/Projects/Create.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/Projects/Create.php @@ -229,8 +229,15 @@ class Create extends Action } $adapter = new AdapterDatabase($dbForProject); - $audit = new Audit($adapter); - $audit->setup(); + try { + $dbForProject->createCollection( + $adapter->getCollectionName(), + $adapter->getAttributeDocuments(), + $adapter->getIndexDocuments(), + ); + } catch (Duplicate) { + // Audit collection already exists + } if ($create) { /** @var array $collections */