Merge branch 'feat-storage-buckets' into feat-large-file
This commit is contained in:
commit
b282ee7c18
2 changed files with 42 additions and 8 deletions
|
@ -2149,6 +2149,17 @@ $collections = [
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'array' => false,
|
'array' => false,
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
'$id' => 'search',
|
||||||
|
'type' => Database::VAR_STRING,
|
||||||
|
'format' => '',
|
||||||
|
'size' => 16384,
|
||||||
|
'signed' => true,
|
||||||
|
'required' => false,
|
||||||
|
'default' => null,
|
||||||
|
'array' => false,
|
||||||
|
'filters' => [],
|
||||||
|
],
|
||||||
],
|
],
|
||||||
'indexes' => [
|
'indexes' => [
|
||||||
[
|
[
|
||||||
|
@ -2157,7 +2168,14 @@ $collections = [
|
||||||
'attributes' => ['name'],
|
'attributes' => ['name'],
|
||||||
'lengths' => [1024],
|
'lengths' => [1024],
|
||||||
'orders' => [Database::ORDER_ASC],
|
'orders' => [Database::ORDER_ASC],
|
||||||
]
|
],
|
||||||
|
[
|
||||||
|
'$id' => '_key_search',
|
||||||
|
'type' => Database::INDEX_FULLTEXT,
|
||||||
|
'attributes' => ['search'],
|
||||||
|
'lengths' => [2048],
|
||||||
|
'orders' => [Database::ORDER_ASC],
|
||||||
|
],
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
|
@ -244,7 +244,27 @@ App::post('/v1/storage/buckets')
|
||||||
'array' => false,
|
'array' => false,
|
||||||
'filters' => [],
|
'filters' => [],
|
||||||
]),
|
]),
|
||||||
|
new Document([
|
||||||
|
[
|
||||||
|
'$id' => 'search',
|
||||||
|
'type' => Database::VAR_STRING,
|
||||||
|
'format' => '',
|
||||||
|
'size' => 16384,
|
||||||
|
'signed' => true,
|
||||||
|
'required' => false,
|
||||||
|
'default' => null,
|
||||||
|
'array' => false,
|
||||||
|
'filters' => [],
|
||||||
|
],
|
||||||
|
]),
|
||||||
], [
|
], [
|
||||||
|
new Document([
|
||||||
|
'$id' => '_key_search',
|
||||||
|
'type' => Database::INDEX_FULLTEXT,
|
||||||
|
'attributes' => ['search'],
|
||||||
|
'lengths' => [2048],
|
||||||
|
'orders' => [Database::ORDER_ASC],
|
||||||
|
]),
|
||||||
new Document([
|
new Document([
|
||||||
'$id' => '_key_bucket',
|
'$id' => '_key_bucket',
|
||||||
'type' => Database::INDEX_KEY,
|
'type' => Database::INDEX_KEY,
|
||||||
|
@ -252,13 +272,6 @@ App::post('/v1/storage/buckets')
|
||||||
'lengths' => [Database::LENGTH_KEY],
|
'lengths' => [Database::LENGTH_KEY],
|
||||||
'orders' => [Database::ORDER_ASC],
|
'orders' => [Database::ORDER_ASC],
|
||||||
]),
|
]),
|
||||||
new Document([
|
|
||||||
'$id' => '_fulltext_name',
|
|
||||||
'type' => Database::INDEX_FULLTEXT,
|
|
||||||
'attributes' => ['name'],
|
|
||||||
'lengths' => [1024],
|
|
||||||
'orders' => [Database::ORDER_ASC],
|
|
||||||
]),
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$bucket = $dbForInternal->createDocument('buckets', new Document([
|
$bucket = $dbForInternal->createDocument('buckets', new Document([
|
||||||
|
@ -276,6 +289,7 @@ App::post('/v1/storage/buckets')
|
||||||
'antiVirus' => $antiVirus,
|
'antiVirus' => $antiVirus,
|
||||||
'$read' => $read,
|
'$read' => $read,
|
||||||
'$write' => $write,
|
'$write' => $write,
|
||||||
|
'search' => implode(' ', [$bucketId, $name]),
|
||||||
]));
|
]));
|
||||||
} catch (Duplicate $th) {
|
} catch (Duplicate $th) {
|
||||||
throw new Exception('Bucket already exists', 409);
|
throw new Exception('Bucket already exists', 409);
|
||||||
|
@ -682,6 +696,7 @@ App::post('/v1/storage/buckets/:bucketId/files')
|
||||||
'openSSLCipher' => $openSSLCipher,
|
'openSSLCipher' => $openSSLCipher,
|
||||||
'openSSLTag' => $openSSLTag,
|
'openSSLTag' => $openSSLTag,
|
||||||
'openSSLIV' => $openSSLIV,
|
'openSSLIV' => $openSSLIV,
|
||||||
|
'search' => implode(' ', [$fileId, $fileName,]),
|
||||||
]));
|
]));
|
||||||
} else {
|
} else {
|
||||||
$file = $dbForInternal->updateDocument('bucket_' . $bucketId, $fileId, $file
|
$file = $dbForInternal->updateDocument('bucket_' . $bucketId, $fileId, $file
|
||||||
|
@ -715,6 +730,7 @@ App::post('/v1/storage/buckets/:bucketId/files')
|
||||||
'comment' => '',
|
'comment' => '',
|
||||||
'chunksTotal' => $chunks,
|
'chunksTotal' => $chunks,
|
||||||
'chunksUploaded' => $chunksUploaded,
|
'chunksUploaded' => $chunksUploaded,
|
||||||
|
'search' => implode(' ', [$fileId, $fileName,]),
|
||||||
]));
|
]));
|
||||||
} else {
|
} else {
|
||||||
$file = $dbForInternal->updateDocument('bucket_' . $bucketId, $fileId, $file
|
$file = $dbForInternal->updateDocument('bucket_' . $bucketId, $fileId, $file
|
||||||
|
|
Loading…
Reference in a new issue