Back

[SOLVED] Appwrite.json auto filled ?

  • 0
  • Tools
  • General
Bouahaza
27 May, 2023, 02:37

No, my appwrite.json is same than before

TL;DR
Issue: User is experiencing difficulties with the Appwrite SDK and is seeking help. Resolution: The user discovered that renaming the prefs.json file and then launching 'appwrite login' resolved the issue. Another user provided a script as a potential solution. Additionally, there was discussion about using multiple prefs.json files and the suggestion to add a warning message when using init without selection. The user also found that making changes in the console and then running init was not recommended. The user also shared their appwrite.json file and realized they hadn't checked the database, feeling silly about it. Finally, there was discussion about updating the appwrite.json file and
Bouahaza
27 May, 2023, 02:38

I've tried entering collections and attributes from the console, without success after appwrite init collection

Drake
27 May, 2023, 02:39

Try init collection again but please share the screenshot right before you press enter

Bouahaza
27 May, 2023, 02:39

from cli or console ?

Bouahaza
27 May, 2023, 02:40

From console

appwrite databases createCollection --databaseId development --collectionId test --name test

should works no ?

Drake
27 May, 2023, 02:41

From cli

Drake
27 May, 2023, 02:41

This should create the collection but it won't update the appwrite.json

Bouahaza
27 May, 2023, 02:42

JSON update is done with init ?

Bouahaza
27 May, 2023, 02:43
Drake
27 May, 2023, 02:44

Yes. I mean after it asks you from which database and before you press enter

Bouahaza
27 May, 2023, 02:44

...... I feel stupid 😄

Bouahaza
27 May, 2023, 02:45

I didn't check the database...

Bouahaza
27 May, 2023, 02:45
TypeScript
{
    "projectId": "new",
    "projectName": "new",
    "databases": [
        {
            "$id": "development",
            "name": "development",
            "$createdAt": "2023-05-27T02:35:38.971+00:00",
            "$updatedAt": "2023-05-27T02:35:38.971+00:00"
        }
    ],
    "collections": [
        {
            "$id": "admins",
            "$permissions": [],
            "databaseId": "development",
            "name": "admins",
            "enabled": true,
            "documentSecurity": false,
            "attributes": [],
            "indexes": []
        }
    ]
}
Bouahaza
27 May, 2023, 02:45

Now it's ok

Bouahaza
27 May, 2023, 02:46

In the documentation, it is recommended to do everything from the cli, to avoid side effects. If I make changes in the console and then run init, should I be okay, or is that not recommended?

Bouahaza
27 May, 2023, 02:46

[SOLVED] Appwrite.json auto filled ?

Drake
27 May, 2023, 02:47

Ya that could be okay

Bouahaza
27 May, 2023, 02:47

In any case, thank you Steven, sorry for the lost time <:appwritepeepo:902865250427215882>

Drake
27 May, 2023, 02:47

No worries

Bouahaza
27 May, 2023, 02:48

Suggestion: Add a warning message when using init without selection?

Bouahaza
27 May, 2023, 03:01

@Steven What are the recommendations for using multiple prefs.json files? One for local, one for stagging, one for production

Drake
27 May, 2023, 03:33

Ya I do something like that

Bouahaza
27 May, 2023, 03:37
  1. Rename prefs.json
  2. Launch appwrite login

That's all ? Ty for script

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