And of course, we need to actually commit at the end of a migration.

This commit sponsored by Tamas Kemenczy.  Thanks, Tamas!
This commit is contained in:
Christopher Allan Webber 2013-02-26 09:58:25 -06:00
parent 0c6a34bf5c
commit 0b7cdb6f3e

View 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()