1
0
Fork 0
mirror of synced 2024-07-02 21:20:58 +12:00

fix: migration

This commit is contained in:
Torsten Dittmann 2022-06-27 18:22:29 +02:00
parent c3c6d00a9c
commit c0649f7385
2 changed files with 5 additions and 6 deletions

View file

@ -106,9 +106,7 @@ abstract class Migration
if ($collection['$collection'] !== Database::METADATA) {
continue;
}
if ($collection['$id'] === 'databases') {
continue;
}
$sum = 0;
$nextDocument = null;
$collectionCount = $this->projectDB->count($collection['$id']);

View file

@ -172,9 +172,6 @@ class V14 extends Migration
$id = $collection->getId();
$internalId = $collection->getInternalId();
if ($this->projectDB->exists(App::getEnv('_APP_DB_SCHEMA', 'appwrite'), "database_1_collection_{$internalId}")) {
return;
}
Console::log("- {$id} ({$collection->getAttribute('name')})");
try {
@ -196,7 +193,11 @@ class V14 extends Migration
name = 'database_1_collection_{$internalId}'
WHERE _uid = 'collection_{$internalId}';
")->execute();
} catch (\Throwable $th) {
Console::warning($th->getMessage());
}
try {
$collection
->setAttribute('databaseId', 'default')
->setAttribute('databaseInternalId', '1');