Fix glance db migration failed on 031
In fact, the first where expression has filtered the duplicated locations, and the second filters the locations which have more than 1 rows, so the second result set is included in the first. In DB2, if the boolean of where expression is true, it will throw error. So remove the second where expression to fix glance db migration failed on 031. Fixes bug #1287087 Change-Id: Id485b6d20696e989d10f3759011387137543918a
This commit is contained in:
parent
f70b72b78b
commit
e687098cf1
@ -33,11 +33,6 @@ def upgrade(migrate_engine):
|
||||
.where(image_locations.c.value == il.c.value)
|
||||
.where(image_locations.c.meta_data == il.c.meta_data)
|
||||
.where(image_locations.c.deleted == False)))
|
||||
.where((sql.select([func.count(image_locations.c.id)])
|
||||
.where(image_locations.c.image_id == il.c.image_id)
|
||||
.where(image_locations.c.value == il.c.value)
|
||||
.where(image_locations.c.meta_data == il.c.meta_data)
|
||||
.where(image_locations.c.deleted == False)) > 1)
|
||||
.where(il.c.deleted == False)
|
||||
.execute()
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user