1
0
Fork 0
mirror of synced 2024-07-07 23:46:11 +12:00

Re-add migration, add missing env vars

This commit is contained in:
Matej Bačo 2022-12-27 08:24:34 +01:00
parent d4091e82e0
commit 804dbb867c
2 changed files with 18 additions and 9 deletions

View file

@ -153,6 +153,9 @@ services:
- _APP_MAINTENANCE_RETENTION_USAGE_HOURLY - _APP_MAINTENANCE_RETENTION_USAGE_HOURLY
- _APP_SMS_PROVIDER - _APP_SMS_PROVIDER
- _APP_SMS_FROM - _APP_SMS_FROM
- _APP_GRAPHQL_MAX_BATCH_SIZE
- _APP_GRAPHQL_MAX_COMPLEXITY
- _APP_GRAPHQL_MAX_DEPTH
appwrite-realtime: appwrite-realtime:
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?> image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>

View file

@ -2,10 +2,8 @@
namespace Appwrite\Migration\Version; namespace Appwrite\Migration\Version;
use Appwrite\Auth\Auth;
use Appwrite\Migration\Migration; use Appwrite\Migration\Migration;
use Utopia\CLI\Console; use Utopia\CLI\Console;
use Utopia\Config\Config;
use Utopia\Database\Database; use Utopia\Database\Database;
use Utopia\Database\Document; use Utopia\Database\Document;
@ -29,8 +27,8 @@ class V17 extends Migration
Console::info('Migrating Collections'); Console::info('Migrating Collections');
$this->migrateCollections(); $this->migrateCollections();
Console::info('Migrating Documents'); // Console::info('Migrating Documents');
$this->forEachDocument([$this, 'fixDocument']); // $this->forEachDocument([$this, 'fixDocument']);
} }
/** /**
@ -48,6 +46,19 @@ class V17 extends Migration
$this->projectDB->setNamespace("_{$this->project->getInternalId()}"); $this->projectDB->setNamespace("_{$this->project->getInternalId()}");
switch ($id) { switch ($id) {
case 'files':
try {
/**
* Update 'mimeType' attribute size (127->255)
*/
$this->projectDB->updateAttribute($id, 'mimeType', Database::VAR_STRING, 255, true, false);
$this->projectDB->deleteCachedCollection($id);
} catch (\Throwable $th) {
Console::warning("'mimeType' from {$id}: {$th->getMessage()}");
}
break;
default: default:
break; break;
} }
@ -64,11 +75,6 @@ class V17 extends Migration
*/ */
protected function fixDocument(Document $document) protected function fixDocument(Document $document)
{ {
switch ($document->getCollection()) {
default:
break;
}
return $document; return $document;
} }
} }