fix: migrate webhooks and users
This commit is contained in:
parent
67403cf95a
commit
467246cc73
1 changed files with 16 additions and 2 deletions
|
@ -4,7 +4,6 @@ namespace Appwrite\Migration\Version;
|
||||||
|
|
||||||
use Appwrite\Migration\Migration;
|
use Appwrite\Migration\Migration;
|
||||||
use Utopia\CLI\Console;
|
use Utopia\CLI\Console;
|
||||||
use Utopia\Database\Database;
|
|
||||||
use Utopia\Database\Document;
|
use Utopia\Database\Document;
|
||||||
|
|
||||||
class V14 extends Migration
|
class V14 extends Migration
|
||||||
|
@ -352,6 +351,15 @@ class V14 extends Migration
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'webhooks':
|
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':
|
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();
|
$internalId = $this->projectDB->getDocument('projects', $document->getAttribute('projectId'))->getInternalId();
|
||||||
|
@ -422,6 +430,12 @@ class V14 extends Migration
|
||||||
$document->setAttribute('$createdAt', $document->getAttribute('dateCreated'));
|
$document->setAttribute('$createdAt', $document->getAttribute('dateCreated'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 'users':
|
||||||
|
if (is_null($document->getAttribute('phoneVerification'))) {
|
||||||
|
$document->setAttribute('phoneVerification', false);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'functions':
|
case 'functions':
|
||||||
if (is_null($document->getCreatedAt())) {
|
if (is_null($document->getCreatedAt())) {
|
||||||
|
|
Loading…
Reference in a new issue