sdk-for-cli
sdk-for-cli copied to clipboard
🐛 Bug Report: Deploy collection does not maintain the order of the attributes defined in the Appwrite.json file
👟 Reproduction steps
run appwrite deploy collection
command
👍 Expected behavior
The order of the defined attributes of the appwrite.json file must be maintained when deployed
👎 Actual Behavior
does not maintain the order of the attributes defined in the appwrite.json file they are sorted randomly
🎲 Appwrite version
Version 1.3.x
💻 Operating system
MacOS
🧱 Your Environment
No response
👀 Have you spent some time to check if this issue has been raised before?
- [X] I checked and didn't find similar issue
🏢 Have you read the Code of Conduct?
- [X] I have read the Code of Conduct
Hi, thanks for opening this issue.
I'm curious, why do you need the order of attributes to be retained?
This should not make any difference in practice.
Hi, thanks for opening this issue.
I'm curious, why do you need the order of attributes to be retained?
This should not make any difference in practice.
Sure but sometimes we want (rather than need) to have things clean to read, grouping attribs by feature/meaning, having most important attribs at the start and so on. It's not because we don't need it that we don't want it :-)
Hmmm we could try to change how we create the collections and attributes:
- Create all collections concurrently
- Concurrently for each collection, create all attributes sequentially
- Wait for all attributes concurrently
If we create all collections first, we shouldn't run into any problems with relationship attributes.
Theoretically, the create attribute API call should return quickly because the actual creation is asynchronous.
- Create all collections concurrently
I sent a pull request with this change. It works perfect for me :)
Hi, thanks for opening this issue.
I'm curious, why do you need the order of attributes to be retained?
This should not make any difference in practice.
As you said, it should make no difference performance wise or anything like that. For me it is relevant to maintain a structured view of the collections/attributes when using the console. For this I either need this to be "fixed" or a flag for it or https://github.com/appwrite/appwrite/issues/2787
On the Appwrite version 1.6, the user will be able to change the order of attributes defined in the Appwrite.json file. The steps to reproduce will be as follows:
- Login to Appwrite with appwrite login
- Initialize a project using appwrite init
- Pull a collection with appwrite pull collections
- Change the order of the attributes listed in appwrite.json
- Delete the collection in the Appwrite Cloud Console
- Push your changes using appwrite push collections
You will be able to confirm the attributes order in your collection are the same as the ones in your appwrite.json file