django icon indicating copy to clipboard operation
django copied to clipboard

Fixed #34907 Handle error of nonexistent table while running loaddata on multidb setup

Open gauravvjn opened this issue 5 months ago • 0 comments

https://code.djangoproject.com/ticket/34907

As explained in the ticket, while running the loaddata, we get the below error. this change would skip the deserialization for this table, which will subsequently allow loaddata to continue without abrupt termination with below error.

django.db.utils.OperationalError: no such table: myapp_naturalkeyanchor

The above exception was the direct cause of the following exception:

.
.
.

File "/Users/gaurav/work/django/django/core/management/commands/loaddata.py", line 251, in load_label
    for obj in objects:
File "/Users/gaurav/work/django/django/core/serializers/json.py", line 74, in Deserializer
    raise DeserializationError() from exc
django.core.serializers.base.DeserializationError: Problem installing fixture 'fixture.json'

gauravvjn avatar Nov 26 '23 06:11 gauravvjn