As far as I can tell this is working. However setting this up was a bit of a hassle. After creating the auth database by getting the auth_* and django_* tables set up, the next step was setting up my first app database.
In our case, we have a base model that every single model we write subclasses, this model simply adds some utility fields that we like, namely 'created_by' and '_last_updated_by'. These are fields that foreign key into Django's 'User' model. The result is that for every single application we deploy, when we migrate, due to dependencies, we get the app's tables, and all the auth_*, django_* tables.
Due to these duplicate tables, my process of setting up an app database is as follows:
1.Create database on server / point django at it / set up router
2. migrate <app> --database=app_db
3. Delete all the duplicate auth_* and django_* tables
4. Run FDW script importing auth_* and django_* tables from auth_db
If I could do something like python manage.py migrate <app> --database=app_db --ignore-dep I could do something like:
1. Create database on server / point django at it / set up router
2. Run FDW script importing auth_* and django_* tables from auth_db
3. migrate <app> --database=app_db --ignore-dep
I could probably streamline steps 1 and 2 somehow.
I understand that without the dependencies the sql output might be invalid as the tables don't exist. I am essentially asking for the ability to deal with the repercussions of not having the correct tables present in the database myself.
All thoughts and criticisms welcome.