Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Bug Report: Deploy collection does not maintain the order of the attributes defined in the Appwrite.json file #79

Closed
2 tasks done
wiandrea opened this issue Apr 17, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@wiandrea
Copy link

👟 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?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@wiandrea wiandrea added the bug Something isn't working label Apr 17, 2023
@wiandrea wiandrea changed the title 🐛 Bug Report: Deploy collection it doesn't maintain the order of the json attributes 🐛 Bug Report: Deploy collection does not maintain the order of the attributes defined in the Appwrite.json file Apr 17, 2023
@gewenyu99
Copy link

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.

@BigPapoo
Copy link

BigPapoo commented Jan 6, 2024

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 :-)

@stnguyen90
Copy link
Contributor

Hmmm we could try to change how we create the collections and attributes:

  1. Create all collections concurrently
  2. Concurrently for each collection, create all attributes sequentially
  3. 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.

@BigPapoo
Copy link

BigPapoo commented Apr 1, 2024

  1. Create all collections concurrently

I sent a pull request with this change. It works perfect for me :)

@w0rsti
Copy link

w0rsti commented May 30, 2024

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 appwrite/appwrite#2787

@choir27
Copy link

choir27 commented Jul 16, 2024

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:

  1. Login to Appwrite with appwrite login
  2. Initialize a project using appwrite init
  3. Pull a collection with appwrite pull collections
  4. Change the order of the attributes listed in appwrite.json
  5. Delete the collection in the Appwrite Cloud Console
  6. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

6 participants