Back

[SOLVED] Replicate attribute in database

  • 0
  • Databases
wilStark43
10 Mar, 2023, 15:09

How can I replicate the structure and attributes in different databases in the same project. Ex: Database 01: [client collection]: {name, age, address} replicate to existing database 02 that contains the following attribute Database 02: [client collection]:{name, age}

TL;DR
User is asking how to replicate a structure and attributes in different databases within the same project in Appwrite. They mention that there is no native support for this, but it can be done using the Appwrite CLI. Another user provides a script on GitHub to automate the deployment process. The original poster marks the thread as solved.
Christy Jacob
10 Mar, 2023, 15:44

unfortunately there is no support for it natively, however you could hack your way to get it done using the Appwrite CLI

rafagazani
10 Mar, 2023, 16:04

Hey guys!. building a structure to create my projects due to this limitation, helps me a lot mainly in the development stage, I will share an example in git for you. It's nothing magnificent but it helps me a lot

wilStark43
10 Mar, 2023, 16:15

ok

rafagazani
10 Mar, 2023, 17:47

@wilStark43 sorry for the delay, here it is https://github.com/rafagazani/church_appwrite_example

rafagazani
10 Mar, 2023, 18:44

I added it to login the appwrite cli and the automatic deployment of the functions that are inside the function folder, I hope it will be useful for you

rafagazani
10 Mar, 2023, 21:49

@wilStark43 can we Mark it as solved?

rafagazani
10 Mar, 2023, 21:50

If you have any questions about how to use it, I'm at your disposal.

wilStark43
10 Mar, 2023, 22:30

Rafa, thank you for your attention! The script is very useful for creating new collections, my goal is to go developing and in case I need to update some new attribute do this cascade into other existing databases.

rafagazani
10 Mar, 2023, 23:18

I'm happy to help, just put the variables in env.py that it takes care of creating. I added the treatments to check if each item already exists, if not, it solves it

rafagazani
10 Mar, 2023, 23:21

in my case I have more than one appwrite on different servers. deploying it was a lot of work, you had to log out through the cli, then log in to the other server and then be able to deploy. With this script I just need to put the env and it does what it needs

rafagazani
10 Mar, 2023, 23:22

If you think this solved your problem. mark it with [SOLVED]

wilStark43
10 Mar, 2023, 23:43

[SOLVED] Replicate attribute in database

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