Open gauravvjn opened 6 years ago
Do you have a traceback for when it fails?
Now in the app, try to delete a user object which is coming from DB1
Shouldn't that cause a traceback then also?
Anyway, I've not investigated into this really - just thought that it would be useful for when doing so.
Without the code there, please also provide your versions of Django, django-fsm-log and Python (at least).
@blueyed: Added required details in the description.
Env:
Scenario:
python manage.py migrate app2 --database=DB2
)python manage.py migrate app1
)python manage.py migrate django_fsm_log --database=DB2
)Now try to delete a user object in the app1, This user object is coming from DB1. you will get an Error saying,
ProgrammingError: (1146, "Table 'DB1.django_fsm_log_statelog' doesn't exist")
which is True. we don't have that table in DB1 but in DB2.After investigating we found that it tries to delete
user.statelog__set
and fail.Source code DB router configuration: database_router.py
And in settings
Even after having database_router configured, it is happening. What can be done here? is there any way in our library to remove this constraint or set ON_DELETE attribute dynamically.
Error Traceback: