mirror of
https://github.com/appwrite/appwrite
synced 2026-05-06 06:48:22 +00:00
fix: internal id twice
This commit is contained in:
parent
8ee78137e6
commit
7028bc1415
1 changed files with 2 additions and 1 deletions
|
|
@ -583,11 +583,11 @@ class V14 extends Migration
|
|||
break;
|
||||
case 'attributes':
|
||||
case 'indexes':
|
||||
$internalId = $this->projectDB->getDocument('database_1', $document->getAttribute('collectionId'))->getInternalId();
|
||||
/**
|
||||
* Add Internal ID 'collectionId' for Subqueries.
|
||||
*/
|
||||
if (!empty($document->getAttribute('collectionId')) && is_null($document->getAttribute('collectionInternalId'))) {
|
||||
$internalId = $this->projectDB->getDocument('database_1', $document->getAttribute('collectionId'))->getInternalId();
|
||||
$document->setAttribute('collectionInternalId', $internalId);
|
||||
}
|
||||
/**
|
||||
|
|
@ -607,6 +607,7 @@ 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_{$internalId}_{$document->getAttribute('key')}"));
|
||||
} catch (\Throwable $th) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue