Retain migration 12 indexes for table image_properties with sqlite.

The upgrade from migration 11 to 12 for sqlite fails to create the
existing indexes when it recreates the image_properties table.

Fixes bug: 1152386

Change-Id: I2ceba3d9c5c45f40564af12fa48c4efba1467021
This commit is contained in:
John Bresnahan 2013-03-07 14:18:46 -10:00
parent df7d9c7171
commit 40c94e7c36
1 changed files with 4 additions and 0 deletions

View File

@ -260,6 +260,10 @@ def _sqlite_table_swap(t_image_members, t_image_properties, t_images):
"RENAME TO image_members")
meta.bind.execute("ALTER TABLE image_properties_backup "
"RENAME TO image_properties")
meta.bind.execute("""CREATE INDEX ix_image_properties_deleted
ON image_properties (deleted);""")
meta.bind.execute("""CREATE INDEX ix_image_properties_name
ON image_properties (name);""")
def _get_table(table_name, metadata):