From b781c3c9281b0356a8b7cc18065610dfccad7fcf Mon Sep 17 00:00:00 2001 From: Jakob Kramer Date: Sat, 19 May 2012 18:17:33 +0200 Subject: added support for original audio download; rename Renamed `ogg' to `webm_audio' in core__file_keynames --- mediagoblin/db/sql/migrations.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'mediagoblin/db/sql/migrations.py') diff --git a/mediagoblin/db/sql/migrations.py b/mediagoblin/db/sql/migrations.py index 98d0d0aa..3b7ee8b4 100644 --- a/mediagoblin/db/sql/migrations.py +++ b/mediagoblin/db/sql/migrations.py @@ -1,5 +1,5 @@ # GNU MediaGoblin -- federated, autonomous media hosting -# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS. +# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -14,4 +14,22 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +from sqlalchemy import MetaData, Table + +from mediagoblin.db.sql.util import RegisterMigration + + MIGRATIONS = {} + + +@RegisterMigration(1, MIGRATIONS) +def ogg_to_webm_audio(db_conn): + metadata = MetaData(bind=db_conn.bind) + + file_keynames = Table('core__file_keynames', metadata, autoload=True, + autoload_with=db_conn.bind) + + db_conn.execute( + file_keynames.update().where(file_keynames.c.name=='ogg'). + values(name='webm_audio') + ) -- cgit v1.2.3