Hello,
I have three realm synced Apps with the same name, one for “development”, one for “qa” and one for “production”.
“development” is on a shared cluster and has its own database.
“qa” and “production” are on a dedicated cluster and have both their own database.
I use GitHub to deploy “development” to Atlas bi-directionnaly.
I use realm-cli to deploy to “qa” and “production” with a GitHub actions script.
Pardon my words, but honestly this is a pain in the “a…” to maintain.
To have a single source of truth, and because it wouldn’t work otherwise anyway,
I have my schemas only on the “development” folder in my GitHub repository.
When deploying to “qa” or “production” I do the following:
cp data_sources/mongodb-atlas/db-development/<collection_name>/schema.json data_sources/mongodb-atlas/db-qa/<collection_name>/
And this has worked once to deploy to “qa” and “prod”.
But now that I retry deploying to “qa”, it doesn’t work I get the following error:
push failed: error fetching schema provider for schemas: two schemas have the same title “CollectionTitle”
And every time I try re-deploying I get a different “CollectionTitle” in the error.
When I look at my apps in Atlas, for each of the apps, only the corresponding database/schemas are defined. The other ones are greyed out. And schemas are not defined for the other apps.
Has anyone been successful in managing schemas with a single source of truth?
Can anyone make sense of this error ?
Thanks.