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.
This commit is contained in:
Jake Barnby
2026-04-30 01:05:54 +12:00
parent fc90b78f35
commit 4e5fbea62c
@@ -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 */