mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 17:08:45 +00:00
sync with feat-migration
This commit is contained in:
parent
a41b767400
commit
3ff5472543
1 changed files with 10 additions and 4 deletions
|
|
@ -207,7 +207,6 @@ App::post('/v1/projects')
|
|||
if (\in_array($dsn->getHost(), $sharedTables)) {
|
||||
$dbForProject
|
||||
->setSharedTables(true)
|
||||
->setTenant($project->getInternalId())
|
||||
->setTenant($globalCollections ? null : $project->getInternalId())
|
||||
->setNamespace($dsn->getParam('namespace'));
|
||||
} else {
|
||||
|
|
@ -225,8 +224,6 @@ App::post('/v1/projects')
|
|||
$create = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($create || !$globalCollections) {
|
||||
$audit = new Audit($dbForProject);
|
||||
$audit->setup();
|
||||
|
|
@ -247,7 +244,16 @@ App::post('/v1/projects')
|
|||
try {
|
||||
$dbForProject->createCollection($key, $attributes, $indexes);
|
||||
} catch (Duplicate) {
|
||||
// Collection already exists
|
||||
if (!$globalCollections) {
|
||||
$dbForProject->createDocument(Database::METADATA, new Document([
|
||||
'$id' => ID::custom($key),
|
||||
'$permissions' => [Permission::create(Role::any())],
|
||||
'name' => $key,
|
||||
'attributes' => $attributes,
|
||||
'indexes' => $indexes,
|
||||
'documentSecurity' => true
|
||||
]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue