india-ultimate / hub

UPAI's membership and payment management portal
https://hub.indiaultimate.org/
GNU Affero General Public License v3.0
6 stars 8 forks source link

Update fixtures with field entities #277

Closed SibiAkkash closed 5 months ago

SibiAkkash commented 5 months ago

i've dumped that data with the latest migrations.

python manage.py dumpdata --exclude=contenttypes > server/fixtures/sample_data.json

@Joe2k: can you check if loading this fixture works and merge ?

punchagan commented 5 months ago

We have a script scripts/update-sample-data.sh. Is there a reason that you didn't use that? :)

SibiAkkash commented 5 months ago

Oh i didn't see that script ;) I'll use that I got a contenttypes Integrity error when i tried dumping data directly, so i excluded that and it seemed to work @punchagan

punchagan commented 5 months ago

May be use an empty DB and try to see if the load works, and allows a new dev to start working with the dumped DB? If you can share the full error, we can dig into it.

SibiAkkash commented 5 months ago

yeah i did try in an empty db, i'll share the errors

SibiAkkash commented 5 months ago

Commands i ran

./scripts/update-sample-data.sh

rm db.sqlite3
python manage.py migrate
python manage.py loaddata server/fixtures/sample_data.json

error: django.db.utils.IntegrityError: Problem installing fixture '/home/sibi/dev/india_ultimate_hub/server/fixtures/sample_data.json': Could not load contenttypes.ContentType(pk=25): UNIQUE constraint failed: django_content_type.app_label, django_content_type.model