#33427: Add new flag in loaddata command that loads fixture without overriding
existing objects with same primary key
-------------------------------------+-------------------------------------
Reporter: Mohit | Owner: nobody
Solanki |
Type: New | Status: new
feature |
Component: Core | Version: dev
(Management commands) | Keywords: loaddata, fixture,
Severity: Normal | command
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Installing fixtures with django's `loaddata` command overrides objects
with the same primary key.
While this is not a problem if you are installing the fixtures against a
fresh DB with no data but in case you have
existing data then loading the fixture can be problematic as all the
existing rows with the same primary key will be updated
with the new data from the fixture(s)
It would be a good idea to have an additional flag that for e.g `--insert-
only` or something that tells django not to override existing objects with
the same primary key.
Note: I created this package https://github.com/mohi7solanki/dj-snake to
solve this issue but I think It would be a good idea to add this
functionality to `loaddata` itself
--
Ticket URL: <https://code.djangoproject.com/ticket/33427>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/055.5960ba6b30b61924e2f00382ae4e1185%40djangoproject.com.