migrations
Autogenerated migration for patients v1 -> v2.
Generated from the v2 ORM via
python -m bitfount.cache.tools.gen_migration patients 2.
The ORM (schema.py) is the source of truth; regenerate rather than hand-edit
(hand-edit only to add a data migration or fix an op autogen got wrong — e.g. a
rename, which autogen renders as drop+add).
Both columns are added NULL on existing rows, and the NULL is meaningful
rather than a placeholder: a v1 row's name was rendered by code that did not
record what it had been rendered from, so the row genuinely cannot say. The
store reads a NULL name_provenance back as NameProvenance.UNKNOWN, which
every real provenance outranks, so the first run to reach one of these patients
replaces the name with one that knows its own source. No backfill is possible
here: name_raw is the string that was thrown away.
Module
Functions
downgrade
def downgrade(op: Operations) ‑> None:Migrate patients v2 -> v1 (see the module docstring).
upgrade
def upgrade(op: Operations) ‑> None:Migrate patients v1 -> v2 (see the module docstring).