item/migrations/0006_add_annotation_sequence.py broken #2857
Labels
No labels
backend
critical
defect
duplicate
enhancement
fixed
frontend
general
invalid
major
minor
normal
oxjs
pandora_client
python-ox
task
trivial
wontfix
worksforme
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: 0x2620/pandora#2857
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
revision 5048 https://wiki.0x2620.org/changeset/pandora%2C5048 moved the code to fill in null public_ids in annotations over from annotation/migrations, but now init_db in a clean install fails:
The "obvious" change to define 'annotation.annotation' and 'clip.clip' in the 'models' dictionary in the migration doesn't do the trick – I guess the entire 'item' app is set up before the 'annotation' app:
Only calling that part if there are items in the database looks like an ok fix for this: []changeset:pandora,5069
It does the trick for new installs, thanks!
I'm not sure that this migration would actually run successfully if there is data, because it still refers to
orm['annotation.Annotation']
but that table is not one of those frozen in themodels
dictionary. (I could be wrong?)You are right,
orm[..]
can only be used for frozen models. The code already imports item.models directly and with it the Annotation model.It was also looping over all annotations twice. Fixed in []changeset:pandora,5070