Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IntegrityError when trying to load fixture #970

Closed
b1rger opened this issue Jun 17, 2024 · 3 comments
Closed

IntegrityError when trying to load fixture #970

b1rger opened this issue Jun 17, 2024 · 3 comments
Assignees

Comments

@b1rger
Copy link
Contributor

b1rger commented Jun 17, 2024

When I try to load data dumped via the dumpdata management command, I get an IntegrityError even if SIMPLE_HISTORY_ENABLED is set to False:

django.db.utils.IntegrityError: Problem installing fixture '/tmp/oebl_20240614.json': Could not load apis_ontology.Person(pk=26697): null value in column "id" of relation "apis_ontology_versionperson" violates not-null constraint
DETAIL:  Failing row contains (null, 26697, null, 1776-07-01, 1776-01-01, 1776-12-31, 1847-07-02, 1847-01-01, 1847-12-31, 1776, 1847, null, Thornton, Jonathan, male, null, null, , , , , , , , , , , , , , , , , , , , , , , 1, 2024-06-17 15:26:58.275199+00, null, ~, null, 137, null).
@b1rger
Copy link
Contributor Author

b1rger commented Jun 17, 2024

The relevant SQL log:

2024-06-17 15:26:58.276 UTC [70] ERROR:  null value in column "id" of relation "apis_ontology_versionperson" violates not-null constraint
2024-06-17 15:26:58.276 UTC [70] DETAIL:  Failing row contains (null, 26697, null, 1776-07-01, 1776-01-01, 1776-12-31, 1847-07-02, 1847-01-01, 1847-12-31, 1776, 1847, null, Thornton, Jonathan, male, null, null, , , , , , , , , , , , , , , , , , , , , , , 1, 2024-06-17 15:26:58.275199+00, null, ~, null, 137, null).
2024-06-17 15:26:58.276 UTC [70] STATEMENT:  INSERT INTO "apis_ontology_versionperson" ("rootobject_ptr_id", "id", "version_tag", "start_date", "start_start_date", "start_end_date", "end_date", "end_start_date", "end_end_date", "start_date_written", "end_date_written", "surname", "forename", "gender", "external_resources", "references", "notes", "oebl_haupttext", "oebl_kurzinfo", "online_edition_haupttext", "nachrecherche", "soziale_herkunft", "verwandtschaft", "ausbildung_studium_studienreise", "berufstaetigkeit_lebenstationen", "mitgliedschaften_orden_auszeichnungen", "literatur", "berufe", "sterbedatum", "adelspraedikat", "uebersiedlung_emigration", "weitere_namensformen", "geburtsdatum", "sterbeort", "geburtsort", "religionen", "name_text", "pseudonyme", "oebl_werkverzeichnis", "self_contenttype_id", "professioncategory_id", "history_date", "history_change_reason", "history_type", "history_user_id") VALUES (26697, NULL, NULL, '1776-07-01'::date, '1776-01-01'::date, '1776-12-31'::date, '1847-07-02'::date, '1847-01-01'::date, '1847-12-31'::date, '1776', '1847', 'Thornton', 'Jonathan', 'male', NULL, NULL, NULL, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', NULL, 137, '2024-06-17T15:26:58.275199+00:00'::timestamptz, NULL, '~', NULL) RETURNING "apis_ontology_versionperson"."history_id"

@sennierer
Copy link
Collaborator

Did you try updating to the latest django_history module? If I recall correctly there was recently a fix that resolves an issue with the setting being ignored.

@b1rger
Copy link
Contributor Author

b1rger commented Jun 18, 2024

thanks, yes, that fixed the problem!

@b1rger b1rger closed this as completed Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants