diff options
Diffstat (limited to 'mediagoblin/db/sql/migrations.py')
-rw-r--r-- | mediagoblin/db/sql/migrations.py | 20 |
1 files changed, 19 insertions, 1 deletions
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 <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') + ) |