mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
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:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user