I have the following issue:
I need a different database with the same models for each user (or set of users). I have a way of finding out to which database the user is related. The issue is I always have to use the using method on every query I make.
For example:
Thing.objects.using('appropriate_database').all()
Is there a way to avoid the use of using and making the user/database relationship implicit somehow?
Sounds like a bad design that can't scale to me. You have to duplicate the schema every time you add a user.
A better design would have a table USER with one-to-many and many-to-many relations with entities required by each user.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With