Skip to content
Snippets Groups Projects
  • stvn's avatar
    42a9e342
    fix: Manually backfill config_id UUIDs again · 42a9e342
    stvn authored
    The previous backfills handled NULL entries;
    this handles empty strings.
    
    The difficulty here was that since the empty string in an invalid UUID
    (as opposed to None/NULL which is just "blank"), attempts to instantiate
    models would fail, given the invalid data. This meant we couldn't use
    the Django ORM to handle the migration entirely; we need to craft some
    raw SQL to work-around these checks and limitations.
    42a9e342
    History
    fix: Manually backfill config_id UUIDs again
    stvn authored
    The previous backfills handled NULL entries;
    this handles empty strings.
    
    The difficulty here was that since the empty string in an invalid UUID
    (as opposed to None/NULL which is just "blank"), attempts to instantiate
    models would fail, given the invalid data. This meant we couldn't use
    the Django ORM to handle the migration entirely; we need to craft some
    raw SQL to work-around these checks and limitations.
0009_backfill-empty-string-config-id.py 1.37 KiB