Back

The best way to write the migration script for database schema for long term maintenacy

  • 0
  • Self Hosted
  • Tools
  • Databases
Suiii
4 Oct, 2023, 03:29

I want to keep track of what have changed in the database schema, collection schema. everytime, there is changes, we create new migration script for example. just like asp.net migration script. how to archeive this. any plan appwrite creating migration script like this in the future.

TL;DR
The OP wants to know the best way to write a migration script for database schema in Appwrite for long-term maintenance. They mention that the Appwrite CLI has a JSON file for clean deployments but it doesn't track changes. They also mention that backup/restore is an option but not easy to keep in sync. They want suggestions on how to keep multiple developers in sync with the same database schema. There is no solution provided in this support thread.
Drake
4 Oct, 2023, 04:09

You can do the same thing as those migration scripts but using the server SDK

Suiii
4 Oct, 2023, 04:10

any good pratical sample to share

Drake
4 Oct, 2023, 04:12

This asp.net example 😜

Suiii
4 Oct, 2023, 04:13

🤣 anyone done in appwrite yet

Drake
4 Oct, 2023, 04:13

Haven't heard of any

Suiii
4 Oct, 2023, 04:14

usually, and pratically, we use console to manage right

Drake
4 Oct, 2023, 04:15

Ya but that's not scripting the migrations...the equivalent thing in asp.net would be to use SQL management studio

Suiii
4 Oct, 2023, 04:16

would you mind suggesting me, what if we have few devs, we have different local dev instance of appwrite, how can we keep everyone sync in the same page, of database schema.

Suiii
4 Oct, 2023, 04:17

backup/restore is option, but won't be easy to keep it synced

Suiii
4 Oct, 2023, 04:19

if appwrite has ability to keep track of what has been changed ( such as collection schema, or even data). then able to generate the chaanges into script and able to share to other to just run it . this would be life saver.

Drake
4 Oct, 2023, 04:20

The appwrite CLI has a json file, but it's only for clean deployments since it deletes attributes and recreates them.

Suiii
4 Oct, 2023, 04:22

yes. right.

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