copy schema when user register for login.

41 views
Skip to first unread message

JAGADESH M

unread,
Nov 8, 2018, 7:19:04 AM11/8/18
to Django users
we are doing SAAS model product. here we need to maintain one database with multiple tables this will be the constant and my main database. since we are doing it as SAAS we need to replicate the same for n number of users. so when new user comes to registration, i need to make copy of main database which will have all the table structure. so when the user login
to his account by default it has to lookup the database which has been created during his/her registration time. i have no idea to go forward can anyone help me to fix this issue. Thank you.



regards,
Jagadesh

Ryan Gedwill

unread,
Nov 8, 2018, 8:57:21 PM11/8/18
to django...@googlegroups.com
This is an interesting problem.

So basically you need to migrate the entire schema upon the creation of a new user? Can the schema change for a new user, or will it always be the exact same? 

From what I understand, you will need to ask the user for credentials for database connection, and then try to see if there is a way to migrate the models from your django code rather than the command line. I’m assuming you don’t want to migrate every single model for every single user, but I know there are ways to only migrate specific models though I forget exactly how.

Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5a335a17-ab5a-4759-ad85-5e47e2e9914f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

JAGADESH M

unread,
Nov 9, 2018, 12:08:36 AM11/9/18
to django...@googlegroups.com
the schema has to change accordingly based on the schema which has been created during the  user registration time.

Reply all
Reply to author
Forward
0 new messages