I have a fixture seed_data.json
on which I have my initial data.
Sometimes I add new data into this fixtures and reload it, which updates my data correctly.
However, I now want to remove some data from it.
So I modified my seed_data.json
, for instance, I had something like that :
{"fields": {"name": "Field 0"},"model": "catalog.product","pk": 1},
{"fields": {"name": "Field 1"},"model": "catalog.product","pk": 2},
{"fields": {"name": "Field 2"},"model": "catalog.product","pk": 3},
# ...
That became :
{"fields": {"name": "Field 1"},"model": "catalog.product","pk": 1},
{"fields": {"name": "Field 2"},"model": "catalog.product","pk": 2},
# ...
But I'm getting :
django.db.utils.IntegrityError: Problem installing fixture .....\seed_data.json
Could not load catalog.Product(pk=2): column name is not unique
So there's no problem when adding some data, but when trying to remove some, there are conflicts with the primary keys.
How can I achieve what I'm trying to do ?