I’d like to keep my testing data separate from my production data(base). How do you all handle staging vs production database? I can’t seem to figure out a way to keep testing records separate from production data without creating a new app.
Thank you! So when your app is published, you just create test records and keep those in between production data? Or do you delete them one-by-one? Or…?
That depend on the app.
For instance, in some apps I have test user accounts, and I know that all data (settings, orders, payments, etc.) linked to this account is a test data.
Sometimes I use a T/F flag like @eduscvs suggested, e.g. not to proceed test payments with production components (although I never delete such data automatically). I used such flags even for the whole organizations in the app (so if org is a test one, all data related to it, including users, products, … is a test data).
Sometimes I create test records as “real” ones, but in a way they could be clearly distinguished from the production data. E.g. have an even set up in the past or far future. Although it’s not a good practice, sometimes it is too difficult to alter the existing app to work with test records properly.
Dumb question, I have about 20 collections in my database all connected, how do I delete all the linked records related to the test-user without having to store a Test-property on each?
I have a similar issue. My “User” collection has relationships with about 20 collections & when I delete users…most of the child records should be deleted too. You cannot do it by listing all down and deleting them as that would be terrible.
Easy Solution (example):
Delete the parent (In my case its the User), now all child records are “orphans”.
The “User” field in all the orphan records in the various collections are now empty.
List all records in a particular collection, filter for User = empty
Use a timer to delete
Do a test first to see that your filter is indeed working correctly/ Once the timer starts deleting, its goodbye data.
If I want to really spring clean my database once users are deleted, I need to create at my “backend” about 20 collection delete lists. I have not done that yet but I will have to do it soon. I figured no harm leaving some "orphaned’ data around.
I am sure other makers have this issue too. It would be great if someone else chimes in.