mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 01:18:37 +00:00
Merge pull request #8553 from appwrite/feat-sync-1.6.x-filters-migrations
Sync 1.6.x Filters and Migrations with latest
This commit is contained in:
commit
39b87fba64
4 changed files with 39 additions and 5 deletions
|
|
@ -3072,8 +3072,8 @@ $projectCollections = array_merge([
|
||||||
'format' => '',
|
'format' => '',
|
||||||
'size' => Database::LENGTH_KEY,
|
'size' => Database::LENGTH_KEY,
|
||||||
'signed' => true,
|
'signed' => true,
|
||||||
'required' => true,
|
'required' => false,
|
||||||
'default' => null,
|
'default' => [],
|
||||||
'array' => true,
|
'array' => true,
|
||||||
'filters' => [],
|
'filters' => [],
|
||||||
],
|
],
|
||||||
|
|
@ -4795,8 +4795,8 @@ $consoleCollections = array_merge([
|
||||||
'format' => '',
|
'format' => '',
|
||||||
'size' => Database::LENGTH_KEY,
|
'size' => Database::LENGTH_KEY,
|
||||||
'signed' => true,
|
'signed' => true,
|
||||||
'required' => false,
|
'required' => true,
|
||||||
'default' => [],
|
'default' => null,
|
||||||
'array' => true,
|
'array' => true,
|
||||||
'filters' => [],
|
'filters' => [],
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -148,6 +148,7 @@ class V21 extends Migration
|
||||||
} catch (\Throwable $th) {
|
} catch (\Throwable $th) {
|
||||||
Console::warning("'scheduleId' from {$id}: {$th->getMessage()}");
|
Console::warning("'scheduleId' from {$id}: {$th->getMessage()}");
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
usleep(50000);
|
usleep(50000);
|
||||||
|
|
@ -194,7 +195,7 @@ class V21 extends Migration
|
||||||
$bucketId = 'bucket_' . $bucket['$internalId'];
|
$bucketId = 'bucket_' . $bucket['$internalId'];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$this->projectDB->updateAttribute($bucketId, 'metadata', size: 75000);
|
$this->projectDB->updateAttribute($bucketId, 'metadata', size: 65534);
|
||||||
$this->projectDB->purgeCachedCollection($bucketId);
|
$this->projectDB->purgeCachedCollection($bucketId);
|
||||||
} catch (\Throwable $th) {
|
} catch (\Throwable $th) {
|
||||||
Console::warning("'bucketId' from {$bucketId}: {$th->getMessage()}");
|
Console::warning("'bucketId' from {$bucketId}: {$th->getMessage()}");
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ class V18 extends Filter
|
||||||
Response::MODEL_FUNCTION => $this->parseFunction($content),
|
Response::MODEL_FUNCTION => $this->parseFunction($content),
|
||||||
Response::MODEL_EXECUTION => $this->parseExecution($content),
|
Response::MODEL_EXECUTION => $this->parseExecution($content),
|
||||||
Response::MODEL_PROJECT => $this->parseProject($content),
|
Response::MODEL_PROJECT => $this->parseProject($content),
|
||||||
|
Response::MODEL_RUNTIME => $this->parseRuntime($content),
|
||||||
default => $parsedResponse,
|
default => $parsedResponse,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -37,6 +38,7 @@ class V18 extends Filter
|
||||||
protected function parseFunction(array $content)
|
protected function parseFunction(array $content)
|
||||||
{
|
{
|
||||||
unset($content['scopes']);
|
unset($content['scopes']);
|
||||||
|
unset($content['specification']);
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -46,4 +48,10 @@ class V18 extends Filter
|
||||||
unset($content['authSessionAlerts']);
|
unset($content['authSessionAlerts']);
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function parseRuntime(array $content)
|
||||||
|
{
|
||||||
|
unset($content['key']);
|
||||||
|
return $content;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -147,4 +147,29 @@ class V18Test extends TestCase
|
||||||
|
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function runtimeProvider(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'remove key' => [
|
||||||
|
[
|
||||||
|
'key' => 'example_key',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
]
|
||||||
|
]
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @dataProvider runtimeProvider
|
||||||
|
*/
|
||||||
|
public function testRuntime(array $content, array $expected): void
|
||||||
|
{
|
||||||
|
$model = Response::MODEL_RUNTIME;
|
||||||
|
|
||||||
|
$result = $this->filter->parse($content, $model);
|
||||||
|
|
||||||
|
$this->assertEquals($expected, $result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue