0

In a Django project, I have a few apps and one model-class will be created in one app's models.py and imported to another apps' models.py. then I run migrate for each app per one schema in Postgres, there is no error reported.

But the issue is the shared model will be migrated to all the schemas because (I assume this is the reason) I imported this model in each app's models.py.

Anyone knows How to avoid or solve this problem. Because I would like keep the model only stay in his original schema. Or can I delete this model directly from each schema it appears?...without any side effects. Please help, Thanks!

Joanna
  • 81
  • 1
  • 6

1 Answers1

0

I found a better answer: Installing PostgreSQL Extension to all schemas. should see this before.

Accidentally found the solution, just use 'public' schema for the app where models supposed to import to other apps.

Just for someone who experience the same situation.

Joanna
  • 81
  • 1
  • 6