When creating an attribute via the console UI vs the CLI there is a difference in the functionality.
The console UI will not allow you to create an array that is "required". When the array box is checked the grays out the required box.
The CLI create attribute commands require the "required" tag and you can successfully create a required array attribute which can not be done in the console UI.
Which is accurate and which is a bug?
It won't matter in both cases When you're creating string attribute as array it will always going to be an array.
That means that the default value would be []
so the value will be filled in any case.
The reason that the Required field become gray it's just to let you know that there is no use to declare it as required.
If you will look here in the Utopia-php database module (this is what Appwrite uses for DB) https://github.com/utopia-php/database/blob/main/src/Database/Database.php#L776
You will find the attribute creation code
$attribute = $this->adapter->createAttribute($collection->getId(), $id, $type, $size, $signed, $array);
And in Appwrite it uses the MariaDB adapter https://github.com/utopia-php/database/blob/main/src/Database/Adapter/MariaDB.php#L173
return $this->getPDO()
->prepare("ALTER TABLE {$this->getSQLTable($name)} ADD COLUMN `{$id}` {$type};")
->execute();
And you can see that the field is going to be created with out any requirements or no null statements
bug report also here: https://github.com/appwrite/console/issues/461
@Steven ? do you know if we are making improvements on this page?
not that i know of
okay, added to our DX thread for improvements 🙂 good to know
Recommended threads
- Query Appwrite
Hello, I have a question regarding Queries in Appwrite. If I have a string "YYYY-MM", how can I query the $createdAt column to match this filter?
- Appwriter Linux Key Bindings
Any tips for configuring appwriter for ubuntu? Actually the keybindings are tightly binded to either windows or mac. Working well on windows but in ubuntu some ...
- Type Mismatch in AppwriteException
There is a discrepancy in the TypeScript type definitions for AppwriteException. The response property is defined as a string in the type definitions, but in pr...