added support for original audio download; rename

Renamed `ogg' to `webm_audio' in core__file_keynames
This commit is contained in:
Jakob Kramer
2012-05-19 18:17:33 +02:00
committed by Joar Wandborg
parent 355fd6770d
commit b781c3c928
5 changed files with 60 additions and 22 deletions

View File

@@ -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 <http://www.gnu.org/licenses/>.
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')
)