1
0
Fork 0
mirror of synced 2024-07-03 21:50:34 +12:00

fix: migrate webhooks and users

This commit is contained in:
Torsten Dittmann 2022-06-21 18:32:04 +02:00
parent 67403cf95a
commit 467246cc73

View file

@ -4,7 +4,6 @@ namespace Appwrite\Migration\Version;
use Appwrite\Migration\Migration;
use Utopia\CLI\Console;
use Utopia\Database\Database;
use Utopia\Database\Document;
class V14 extends Migration
@ -352,8 +351,17 @@ class V14 extends Migration
break;
case 'webhooks':
if (empty($document->getAttribute('signatureKey'))) {
$document->setAttribute('signatureKey', \bin2hex(\random_bytes(64)));
}
if (!empty($document->getAttribute('projectId')) && is_null($document->getAttribute('projectInternalId'))) {
$internalId = $this->projectDB->getDocument('projects', $document->getAttribute('projectId'))->getInternalId();
$document->setAttribute('projectInternalId', $internalId);
}
break;
case 'domains':
if (!empty($document->getAttribute('projectId')) && is_null($document->getAttribute('projectInternalId'))) {
if (!empty($document->getAttribute('projectId')) && is_null($document->getAttribute('projectInternalId'))) {
$internalId = $this->projectDB->getDocument('projects', $document->getAttribute('projectId'))->getInternalId();
$document->setAttribute('projectInternalId', $internalId);
}
@ -422,6 +430,12 @@ class V14 extends Migration
$document->setAttribute('$createdAt', $document->getAttribute('dateCreated'));
}
break;
case 'users':
if (is_null($document->getAttribute('phoneVerification'))) {
$document->setAttribute('phoneVerification', false);
}
break;
case 'functions':
if (is_null($document->getCreatedAt())) {