Back

Is it possible to created collection, attributes, indexes & config permission using script?

  • 0
  • Databases
  • Tools
Vedsaga
12 Mar, 2023, 11:00

I have been Designing SQL DB schema, keeping in mind Relationship between each table. So, I ended-up with 30+ Tables (500+ lines) of SQL command to created each-table and indexes. I wonder, if is it possible to write a script which can be executed to created relevant collection if I feed attribute and it's data-type and indexes ?

TL;DR
The user is asking if it's possible to create collections, attributes, indexes, and config permissions using a script. They mention that the logs don't help much and they encountered errors while trying to trigger a function. They also ask for an example of push notification. Another user suggests using the Appwrite Console or the UX interface to create the collections, but the original user finds it time-consuming. There is a discussion about creating a JSON file manually or using the CLI command. Finally, another user suggests checking the `appwrite databases` CLI command for possible commands, including creating collections, string attributes, and indexes. There is uncertainty about config
Vedsaga
12 Mar, 2023, 11:00

cc @Steven

bhaskarsingh
12 Mar, 2023, 15:46

You can check appwrite databases using this CLI command it will show all the possible commands You will get the some option like these and many more:

TypeScript
createCollection
createStringAttribute
createIndex

Not sure about config permission.

Vedsaga
13 Mar, 2023, 02:23

thank you, seems it will solve. Just that not sure about adding indexes & attributes... so far in the doc nothing seems be mentioned.

Vedsaga
13 Mar, 2023, 02:25

thank you πŸ™‚

Vedsaga
13 Mar, 2023, 02:41

seems it's script is kinda not possible.

Vedsaga
13 Mar, 2023, 02:45

umm, so like we have create script to write json and then feed json cli?

Drake
13 Mar, 2023, 02:46

Or manually make the JSON file

Vedsaga
13 Mar, 2023, 02:46

πŸ˜Άβ€πŸŒ«οΈ

Vedsaga
13 Mar, 2023, 02:47

that's alot time taking... I guess I will go with UX

Drake
13 Mar, 2023, 02:48

It'd be copying and pasting each attribute but sure you can script whatever.

What do you mean you'll go with UX?

Vedsaga
13 Mar, 2023, 02:48

I mean UX interface app-write

Drake
13 Mar, 2023, 03:04

The Appwrite Console?

Vedsaga
13 Mar, 2023, 03:04

yap I mean πŸ˜…

Vedsaga
13 Mar, 2023, 03:05

btw any example for push-notification?

Vedsaga
13 Mar, 2023, 03:11

@Steven getting erros while trying to trigger the function..

Vedsaga
13 Mar, 2023, 03:11

logs also doesn't help much

Drake
13 Mar, 2023, 03:20

Best to create a new <#1072905050399191082> post

Vedsaga
13 Mar, 2023, 03:21

let me 1 min

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