Back

[SOLVED] CLI deploy = mess in the attribs

  • 0
  • Tools
Gildas Quiniou
6 Jan, 2024, 23:19

Hi, trying to sort the attribs on a freshly created collection, I used the CLI appwrite deploy collection command but I ended with a new collection much more messy than what I created at first! I expected the attributes to be sorted as they appear in my appwrite.json file. Is there a way to achieve this? Thx.

TL;DR
User experienced an issue with the `appwrite deploy collection` command while trying to sort attributes in a newly created collection. The attributes were not sorted as expected. User suggested sticking with the initial randomness of attributes. A possible solution is to use a server SDK and write a script. User also mentioned submitting a pull request for a `--preserve` option in the `deploy collection` command.
Drake
6 Jan, 2024, 23:25

You'll have to write a script using a server SDK

Drake
6 Jan, 2024, 23:25

Or fork the CLI lol

Drake
6 Jan, 2024, 23:26

You might also want to add a πŸ‘ to this issue: https://github.com/appwrite/sdk-for-cli/issues/79

Drake
6 Jan, 2024, 23:28

The reason why is all the attributes are created at once: https://github.com/appwrite/sdk-for-cli/blob/ae7f9fecbbe5cc0cc702e878fd48cc8559fa18b2/lib/commands/deploy.js#L640 and so when they actually get created or finish creating is "random"

Gildas Quiniou
6 Jan, 2024, 23:32

OK thx, I suspected something with the asynchronous way of creating the attribs... πŸ™‚ Well, I think I will stick with the randomness of my initial attribs as they are less random than what I ended up! πŸ™‚

Gildas Quiniou
7 Jan, 2024, 13:38

[SOLVED] CLI deploy = mess in the attribs

Gildas Quiniou
7 Jan, 2024, 13:56

I submitted a PR with a --preserve option for deploy collection.

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more