chore(release): prepare 0.11.0 release
This commit is contained in:
parent
0b084cbf5f
commit
441156da7c
|
@ -58,7 +58,7 @@ docker run -it --rm \
|
|||
--volume /var/run/docker.sock:/var/run/docker.sock \
|
||||
--volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
|
||||
--entrypoint="install" \
|
||||
appwrite/appwrite:0.10.4
|
||||
appwrite/appwrite:0.11.0
|
||||
```
|
||||
|
||||
### Windows
|
||||
|
@ -70,7 +70,7 @@ docker run -it --rm ^
|
|||
--volume //var/run/docker.sock:/var/run/docker.sock ^
|
||||
--volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^
|
||||
--entrypoint="install" ^
|
||||
appwrite/appwrite:0.10.4
|
||||
appwrite/appwrite:0.11.0
|
||||
```
|
||||
|
||||
#### PowerShell
|
||||
|
@ -80,7 +80,7 @@ docker run -it --rm ,
|
|||
--volume /var/run/docker.sock:/var/run/docker.sock ,
|
||||
--volume ${pwd}/appwrite:/usr/src/code/appwrite:rw ,
|
||||
--entrypoint="install" ,
|
||||
appwrite/appwrite:0.10.4
|
||||
appwrite/appwrite:0.11.0
|
||||
```
|
||||
|
||||
Once the Docker installation completes, go to http://localhost to access the Appwrite console from your browser. Please note that on non-linux native hosts, the server might take a few minutes to start after installation completes.
|
||||
|
|
|
@ -26,7 +26,6 @@ use Appwrite\Database\Adapter\Redis as RedisAdapter;
|
|||
use Appwrite\Database\Document;
|
||||
use Appwrite\Database\Validator\Authorization;
|
||||
use Appwrite\Event\Event;
|
||||
use Appwrite\Event\Realtime;
|
||||
use Appwrite\OpenSSL\OpenSSL;
|
||||
use Utopia\App;
|
||||
use Utopia\View;
|
||||
|
@ -48,8 +47,8 @@ const APP_USERAGENT = APP_NAME.'-Server v%s. Please report abuse at %s';
|
|||
const APP_MODE_DEFAULT = 'default';
|
||||
const APP_MODE_ADMIN = 'admin';
|
||||
const APP_PAGING_LIMIT = 12;
|
||||
const APP_CACHE_BUSTER = 160;
|
||||
const APP_VERSION_STABLE = '0.10.4';
|
||||
const APP_CACHE_BUSTER = 170;
|
||||
const APP_VERSION_STABLE = '0.11.0';
|
||||
const APP_STORAGE_UPLOADS = '/storage/uploads';
|
||||
const APP_STORAGE_FUNCTIONS = '/storage/functions';
|
||||
const APP_STORAGE_CACHE = '/storage/cache';
|
||||
|
|
|
@ -48,6 +48,7 @@ abstract class Migration
|
|||
'0.10.2' => 'V09',
|
||||
'0.10.3' => 'V09',
|
||||
'0.10.4' => 'V09',
|
||||
'0.10.0' => 'V10',
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -102,7 +103,9 @@ abstract class Migration
|
|||
foreach ($all as $document) {
|
||||
go(function () use ($document, $callback) {
|
||||
if (empty($document->getId()) || empty($document->getCollection())) {
|
||||
Console::warning('Skipped Document due to missing ID or Collection.');
|
||||
if ($document->getCollection() !== 0) {
|
||||
Console::warning('Skipped Document due to missing ID or Collection.');
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -133,7 +136,7 @@ abstract class Migration
|
|||
|
||||
public function check_diff_multi($array1, $array2){
|
||||
$result = array();
|
||||
|
||||
|
||||
foreach($array1 as $key => $val) {
|
||||
if(is_array($val) && isset($array2[$key])) {
|
||||
$tmp = $this->check_diff_multi($val, $array2[$key]);
|
||||
|
@ -147,14 +150,14 @@ abstract class Migration
|
|||
elseif($val !== $array2[$key]) {
|
||||
$result[$key] = $array2[$key];
|
||||
}
|
||||
|
||||
|
||||
if(isset($array2[$key])) {
|
||||
unset($array2[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$result = array_merge($result, $array2);
|
||||
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
|
48
src/Appwrite/Migration/Version/V10.php
Normal file
48
src/Appwrite/Migration/Version/V10.php
Normal file
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
namespace Appwrite\Migration\Version;
|
||||
|
||||
use Appwrite\Migration\Migration;
|
||||
use Utopia\CLI\Console;
|
||||
use Appwrite\Database\Database;
|
||||
use Appwrite\Database\Document;
|
||||
|
||||
class V10 extends Migration
|
||||
{
|
||||
public function execute(): void
|
||||
{
|
||||
$project = $this->project;
|
||||
Console::log('Migrating project: ' . $project->getAttribute('name') . ' (' . $project->getId() . ')');
|
||||
|
||||
$this->forEachDocument([$this, 'fixDocument']);
|
||||
}
|
||||
|
||||
protected function fixDocument(Document $document)
|
||||
{
|
||||
switch ($document->getAttribute('$collection')) {
|
||||
/**
|
||||
* Add version reference to database.
|
||||
*/
|
||||
case Database::SYSTEM_COLLECTION_PROJECTS:
|
||||
$document->setAttribute('version', '0.11.0');
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
foreach ($document as &$attr) {
|
||||
if ($attr instanceof Document) {
|
||||
$attr = $this->fixDocument($attr);
|
||||
}
|
||||
|
||||
if (\is_array($attr)) {
|
||||
foreach ($attr as &$child) {
|
||||
if ($child instanceof Document) {
|
||||
$child = $this->fixDocument($child);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $document;
|
||||
}
|
||||
}
|
31
tests/unit/Migration/MigrationV10Test.php
Normal file
31
tests/unit/Migration/MigrationV10Test.php
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
namespace Appwrite\Tests;
|
||||
|
||||
use ReflectionClass;
|
||||
use Appwrite\Database\Database;
|
||||
use Appwrite\Database\Document;
|
||||
use Appwrite\Migration\Version\V10;
|
||||
|
||||
class MigrationV09Test extends MigrationTest
|
||||
{
|
||||
public function setUp(): void
|
||||
{
|
||||
$this->pdo = new \PDO('sqlite::memory:');
|
||||
$this->migration = new V10($this->pdo);
|
||||
$reflector = new ReflectionClass('Appwrite\Migration\Version\V10');
|
||||
$this->method = $reflector->getMethod('fixDocument');
|
||||
$this->method->setAccessible(true);
|
||||
}
|
||||
|
||||
public function testMigration()
|
||||
{
|
||||
$document = $this->fixDocument(new Document([
|
||||
'$id' => 'project',
|
||||
'$collection' => Database::SYSTEM_COLLECTION_PROJECTS,
|
||||
'version' => '0.10.0'
|
||||
]));
|
||||
|
||||
$this->assertEquals($document->getAttribute('version', '0.10.0'), '0.110');
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue