1
0
Fork 0
mirror of synced 2024-10-01 09:47:43 +13:00

Merge pull request #3455 from appwrite/fix-migration-0-15-1

fix: internal attribute and index key on migration
This commit is contained in:
Torsten Dittmann 2022-06-29 12:56:18 +02:00 committed by GitHub
commit cfaf3efa85
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -607,8 +607,9 @@ class V14 extends Migration
/**
* Re-create Collection Document
*/
$internalId = $this->projectDB->getDocument('database_1', $document->getAttribute('collectionId'))->getInternalId();
$this->projectDB->deleteDocument($document->getCollection(), $document->getId());
$this->projectDB->createDocument($document->getCollection(), $document->setAttribute('$id', "1_{$document->getInternalId()}_{$document->getAttribute('key')}"));
$this->projectDB->createDocument($document->getCollection(), $document->setAttribute('$id', "1_{$internalId}_{$document->getAttribute('key')}"));
} catch (\Throwable $th) {
Console::warning("Create Collection Document - {$th->getMessage()}");
}