And of course, we need to actually commit at the end of a migration.
authorChristopher Allan Webber <cwebber@dustycloud.org>
Tue, 26 Feb 2013 15:58:25 +0000 (09:58 -0600)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Tue, 26 Feb 2013 15:58:25 +0000 (09:58 -0600)
This commit sponsored by Tamas Kemenczy.  Thanks, Tamas!

mediagoblin/db/migrations.py

index 05dc31ef11c2cbc0681b9f2df9b88f2a57877de3..0a3bf825546a14c5e1b5800cd743a61f1e7c9b7d 100644 (file)
@@ -241,6 +241,7 @@ def mediaentry_new_slug_era(db):
     metadata = MetaData(bind=db.bind)
 
     media_table = inspect_table(metadata, 'core__media_entries')
+
     for row in db.execute(media_table.select()):
         # no slug, try setting to an id
         if not row.slug:
@@ -249,3 +250,5 @@ def mediaentry_new_slug_era(db):
         elif u"=" in row.slug or u":" in row.slug:
             append_garbage_till_unique(
                 row, row.slug.replace(u"=", u"-").replace(u":", u"-"))
+
+    db.commit()