Skip to content

Commit 8a56e92

Browse files
Merge pull request #76 from ArnabChatterjee20k/fix/index-migration-issue-from-1.6.0
index migration issue from 1.6.0 to 1.6.x
2 parents f8b5472 + 235fe53 commit 8a56e92

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/Migration/Sources/Appwrite.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Appwrite\Services\Teams;
1212
use Appwrite\Services\Users;
1313
use Utopia\Database\Database as UtopiaDatabase;
14+
use Utopia\Database\DateTime as UtopiaDateTime;
1415
use Utopia\Migration\Exception;
1516
use Utopia\Migration\Resource;
1617
use Utopia\Migration\Resources\Auth\Hash;
@@ -921,8 +922,8 @@ private function exportIndexes(int $batchSize): void
921922
$index['attributes'],
922923
[],
923924
$index['orders'],
924-
$index['$createdAt'],
925-
$index['$updatedAt'],
925+
$index['$createdAt'] = empty($index['$createdAt']) ? UtopiaDateTime::now() : $index['$createdAt'],
926+
$index['$updatedAt'] = empty($index['$updatedAt']) ? UtopiaDateTime::now() : $index['$updatedAt'],
926927
);
927928
}
928929

0 commit comments

Comments
 (0)