Skip to content

Commit

Permalink
WIP overlay migration fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aschampion committed Nov 29, 2016
1 parent fa20b98 commit 2c56e87
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def forward_update_stack_groups(apps, schema_editor):
stacks linked to respective class instance to new stack group.
"""
ClassInstance = apps.get_model('catmaid', 'ClassInstance')
StackGroup = apps.get_model('catmaid', 'StackGroup')
existing_stackgroups = ClassInstance.objects.filter(
class_column__class_name='stackgroup')

Expand Down Expand Up @@ -56,7 +57,7 @@ def forward_update_stack_groups(apps, schema_editor):
JOIN relation r
ON sci.relation_id = r.id
JOIN stack_group_relation sgr
ON sgr.name LIKE "%" || r.relation_name
ON sgr.name LIKE '%' || r.relation_name
""".format(sg_pattern))


Expand Down Expand Up @@ -148,8 +149,8 @@ def forward_migrate_overlays(apps, schema_editor):


forward_create_stack_mirrors = """
INSERT INTO stack_mirror (stack_id, title, image_base, file_extension, tile_width, tile_height, tile_source_type)
SELECT s.id, 'Default', s.image_base, s.file_extension, s.tile_width, s.tile_height, s.tile_source_type
INSERT INTO stack_mirror (stack_id, title, image_base, file_extension, tile_width, tile_height, tile_source_type, position)
SELECT s.id, 'Default', s.image_base, s.file_extension, s.tile_width, s.tile_height, s.tile_source_type, 0
FROM stack s;
"""

Expand Down

0 comments on commit 2c56e87

Please sign in to comment.