aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2013-02-26 09:58:25 -0600
committerChristopher Allan Webber <cwebber@dustycloud.org>2013-02-26 09:58:25 -0600
commit0b7cdb6f3ec1c6e053df02434ead8714dc0cb32f (patch)
treec61d11c1fecb1b97560536eb0d1131820e9c868f
parent0c6a34bf5ceee7ec6b95287d4464772a0618ff8d (diff)
downloadmediagoblin-0b7cdb6f3ec1c6e053df02434ead8714dc0cb32f.tar.lz
mediagoblin-0b7cdb6f3ec1c6e053df02434ead8714dc0cb32f.tar.xz
mediagoblin-0b7cdb6f3ec1c6e053df02434ead8714dc0cb32f.zip
And of course, we need to actually commit at the end of a migration.
This commit sponsored by Tamas Kemenczy. Thanks, Tamas!
-rw-r--r--mediagoblin/db/migrations.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/mediagoblin/db/migrations.py b/mediagoblin/db/migrations.py
index 05dc31ef..0a3bf825 100644
--- a/mediagoblin/db/migrations.py
+++ b/mediagoblin/db/migrations.py
@@ -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()