details: http://www.bx.psu.edu/hg/galaxy/rev/86cc0b2b9e09 changeset: 2931:86cc0b2b9e09 user: James Taylor <james@jamestaylor.org> date: Thu Oct 29 10:06:11 2009 -0400 description: Fix page migration for mysql diffstat: lib/galaxy/model/migrate/versions/0024_page_slug_unique_constraint.py | 17 ++++++-- 1 files changed, 13 insertions(+), 4 deletions(-) diffs (29 lines): diff -r 1aafea08f0e8 -r 86cc0b2b9e09 lib/galaxy/model/migrate/versions/0024_page_slug_unique_constraint.py --- a/lib/galaxy/model/migrate/versions/0024_page_slug_unique_constraint.py Thu Oct 29 09:25:52 2009 -0400 +++ b/lib/galaxy/model/migrate/versions/0024_page_slug_unique_constraint.py Thu Oct 29 10:06:11 2009 -0400 @@ -21,12 +21,21 @@ Page_table = Table( "page", metadata, autoload=True ) - i = Index( "ix_page_slug", Page_table.c.slug ) - i.drop() + try: + + # Sqlite doesn't support .alter, so we need to drop an recreate - i = Index( "ix_page_slug", Page_table.c.slug, unique=False ) - i.create() + i = Index( "ix_page_slug", Page_table.c.slug ) + i.drop() + + i = Index( "ix_page_slug", Page_table.c.slug, unique=False ) + i.create() + except: + + # Mysql doesn't have a named index, but alter should work + + Page_table.c.slug.alter( unique=False ) def downgrade(): metadata.reflect()