1
0
Fork 0
mirror of synced 2024-06-02 19:04:49 +12:00
This commit is contained in:
shimon 2022-06-20 14:44:04 +03:00
parent 0c2c030b71
commit 27333035c0
2 changed files with 3 additions and 30 deletions

View file

@ -125,6 +125,8 @@ App::post('/v1/projects')
if (($collection['$collection'] ?? '') !== Database::METADATA) {
continue;
}
$attributes = [];
$indexes = [];
@ -151,7 +153,7 @@ App::post('/v1/projects')
'orders' => $index['orders'],
]);
}
var_dump($key);
$dbForProject->createCollection($key, $attributes, $indexes);
}

View file

@ -123,35 +123,6 @@ App::post('/v1/storage/buckets')
$dbForProject->createCollection('bucket_' . $bucket->getInternalId(), $attributes, $indexes);
$attributes = [];
$indexes = [];
$videos = Config::getParam('collections', [])['videos'] ?? [];
foreach ($videos['attributes'] as $attribute) {
$attributes[] = new Document([
'$id' => $attribute['$id'],
'type' => $attribute['type'],
'size' => $attribute['size'],
'required' => $attribute['required'],
'signed' => $attribute['signed'],
'array' => $attribute['array'],
'filters' => $attribute['filters'],
'default' => $attribute['default'] ?? null,
'format' => $attribute['format'] ?? ''
]);
}
foreach ($videos['indexes'] as $index) {
$indexes[] = new Document([
'$id' => $index['$id'],
'type' => $index['type'],
'attributes' => $index['attributes'],
'lengths' => $index['lengths'],
'orders' => $index['orders'],
]);
}
$dbForProject->createCollection('bucket_' . $bucket->getInternalId() . '_video_renditions', $attributes, $indexes);
} catch (Duplicate $th) {
throw new Exception('Bucket already exists', 409, Exception::STORAGE_BUCKET_ALREADY_EXISTS);
}