Understanding Legacy DB Connection & django_ Created Tables

Before I make a huge mess, can someone help me understand what will happen when I connect my application to a legacy (Oracle) database and the Django installation tables, such as django_admin_login, auth_group_, auth_user. After running inspectdb to create the Models, what will happen when I run migrations, will the django_ tables be added to that Oracle database? Or where will the other* tables live?

Thanks!

Welcome @twist2 !

The direct answer is that it will be whatever you want it to be. What that is, will depend upon what you’re trying to do here.

If you want your project to access that Oracle database as a “read-only” (“reference”) db, then you would want to set it up as a secondary database. Seehttps://docs.djangoproject.com/en/5.1/topics/db/multi-db/

If you are not in control of that database, then you do not want to run migrations on it. After running inspectdb and fixing it, ensure that the Meta class has managed = False on every table.

And, you’ll still want to have a database for your Django-required and your own models that you may need to create.

(We do this frequently - we have a number of projects accessing application databases that are used by other systems.)