replaced create attribute with a util createAttributeFromCollection method

This commit is contained in:
ArnabChatterjee20k 2025-08-06 10:56:42 +05:30
parent 066c801a45
commit 320171822c

View file

@ -2,7 +2,6 @@
namespace Appwrite\Migration\Version;
use Appwrite\ID;
use Appwrite\Migration\Migration;
use Exception;
use Throwable;
@ -46,15 +45,7 @@ class V23 extends Migration
// since required + default can't be used together
// so first creating the attribute then bulk updating the attribute
$this->dbForProject->createAttributes('databases', [new Document([
'$id' => ID::custom('type'),
'type' => Database::VAR_STRING,
'size' => 128,
'required' => true,
'signed' => true,
'array' => false,
'filters' => [],
])]);
$this->createAttributeFromCollection($this->dbForProject, 'databases', 'type');
$this->dbForProject->updateDocuments('databases', new Document(['type' => 'sql']));
}