I am currently creating a database with the collections and appropriate attributes. No data has been entered yet, still in the development stage.
I need to change the attribute size but it does not allow it. Is there a way to change? Otherwise, you need to delete the attribute and re-enter. But what happens once it's in production and an attribute size needs to increase?
I am coming from environments where the size of a field is not defined. For example, in a notes field, you set it up for 1000 characters but you need it to be as small as 0 or as big as 100000, automatically size variable length.
If I create fields bigger than what I need, is the storage size increased, or only use the characters entered?
Thank you for any suggestions, I appreciate it.
Changing a size can cause your database to lock up while the operation is done. The proper way to handle this in production is to do it in multiple steps. You can search online for zero downtime schema migrations
I am used to using MS SQL Server where you can modify columns (attributes) in their Management Studio and it’s done. Scheduling database alterations were done at night time since the users are day only.
I believe you are speaking about duplicating the database, altering the scheme, copying the database, and so on…
- I was looking at Appwrite documentation at https://appwrite.io/docs/references/cloud/server-dart/databases#updateStringAttribute and I do not see an option to change the size of the attribute.
- If I create an attribute bigger than what I need, is the storage size increased, or only use the characters entered? For example, for a Text attribute with size 10,000 and the user only entered 10 characters, what is the size that is used on disk, 10,000 or 10 characters?
I am creating new apps and hopefully converting my apps from other platforms to Appwrite and I am trying to figure these things out.
Thank you for your help.
Modifying columns on big tables can lock up the database.
- Yes, because it's not available.
- The underlying column type depends on the size you select for the string attribute. See https://github.com/utopia-php/database/blob/b6880e560242ef5629a4eeff334192bc342070de/src/Database/Adapter/MariaDB.php#L2103
I understand what you are saying.
Since this is not accomplishable in the database dashboard, is there any documentation or FAQ on the Appwrite site handling changing an attribute size or how to accomplish changes by code?
Thank you for your help.
Not at the moment, but you'd use the various server methods: https://appwrite.io/docs/references/cloud/server-rest/databases
I think this is the part that I do not understand how the increase the size of the string attribute since the size parameter is missing:
https://appwrite.io/docs/references/cloud/server-rest/databases#updateStringAttribute
Thanks.
Please create a separate #🚑│support post instead of posting in someone else's old thread
I did @ https://discord.com/channels/564160730845151244/1249577664138973194 but no response so far. Just want some clarifications
Recommended threads
- Update User Error
```ts const { users, databases } = await createAdminClient(); const session = await getLoggedInUser(); const user = await users.get(session.$id); if (!use...
- Our Appwrite organization is suspended
Please give support regarding this , no app is working now , please solve my issue and give support , no one is replying in message section or email.
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...