Living-with-machines / lwmdb

A django-based library for managing the Living with Machines newspapers metadata database schema
https://living-with-machines.github.io/lwmdb/
MIT License
2 stars 0 forks source link

Allow `null` values for `created_at` and `modified_at` fields until canonical `json` fixtures are addressed #113

Closed griff-rees closed 1 year ago

griff-rees commented 1 year ago

At present,json files provided by https://github.com/Living-with-machines/alto2txt2fixture do not include created_at and modified_at fields, which are required for Gazetteer and Mitchells models. Making those optional for the time being to test these fixtures.

griff-rees commented 1 year ago

Example load failure for reference:

$ ./manage.py loaddata mitchells/fixtures/mitchells.Entry.json
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/psycopg/cursor.py", line 723, in execute
    raise ex.with_traceback(None)
psycopg.errors.NotNullViolation: null value in column "created_at" of relation "mitchells_entry" violates not-null constraint
DETAIL:  Failing row contains (1, null, null, LLOYD'S WEEKLY LONDON NEWSPAPER ., "['democratic', 'anti-poor-law']", "['3d']", 1846, "November , 1842", Saunday, , , , [], [], 1, 1377, 960).
griff-rees commented 1 year ago

See alto2txt2fixture #8