Próbuję zrzucić dane z mojego serwera produkcyjnego do użycia jako test na moim serwerze dev, ale dostaję błędy podczas uruchamiania "testu ./manage.py" na serwer dev określający plik urządzenia utworzony na serwerze prod.Urządzenia django (z dumpdata) uległy awarii podczas testowania
Oto stara zrobiłem w oparciu o Google Search/stackoverflow:
# python manage.py dumpdata --indent=4 --natural
error when running tests: IntegrityError: (1062, "Duplicate entry 'cms-agencies' for key 'app_label'")
# python manage.py dumpdata --exclude contenttypes --indent=4
error when running tests: IntegrityError: (1452, 'Cannot add or update a child row: a foreign key constraint fails (`test_current`.`django_admin_log`, CONSTRAINT `content_type_id_refs_id_288599e6` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`))')
# python manage.py dumpdata --exclude contenttypes --natural --indent=4
error when running tests: IntegrityError: (1062, "Duplicate entry '14-add_agencies' for key 'content_type_id'")
# python manage.py dumpdata --exclude contenttypes --exclude auth --indent=4
error when running tests: IntegrityError: (1452, 'Cannot add or update a child row: a foreign key constraint fails (`test_current`.`django_admin_log`, CONSTRAINT `user_id_refs_id_c8665aa` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`))')
# python manage.py dumpdata --exclude contenttypes --exclude auth --natural --indent=4
error when running tests: IntegrityError: (1452, 'Cannot add or update a child row: a foreign key constraint fails (`test_current_abril`.`django_admin_log`, CONSTRAINT `user_id_refs_id_c8665aa` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`))')
Próbowałem też usuwając " 'init_command': 'SET storage_engine = InnoDB" od settings.py i wciąż mam 1062 błędów.
Nie rozumiem tego problemu. Czy nie powinienem django odtworzyć bazy danych dokładnie tak, jak było to na serwerze prod, kiedy ładuję urządzenia?
zgodził chcielibyśmy opcję, aby po prostu zrobić dokładną kopię db –