aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db/sql/migrations.py
diff options
context:
space:
mode:
authorJakob Kramer <jakob.kramer@gmx.de>2012-05-19 18:17:33 +0200
committerJoar Wandborg <git@wandborg.com>2012-05-20 18:32:56 +0200
commitb781c3c9281b0356a8b7cc18065610dfccad7fcf (patch)
tree46a45a6b49ddf80a6f9ff3837cc76ac65d8bce95 /mediagoblin/db/sql/migrations.py
parent355fd6770dce14cf45fd696cda542cb190bb42cb (diff)
downloadmediagoblin-b781c3c9281b0356a8b7cc18065610dfccad7fcf.tar.lz
mediagoblin-b781c3c9281b0356a8b7cc18065610dfccad7fcf.tar.xz
mediagoblin-b781c3c9281b0356a8b7cc18065610dfccad7fcf.zip
added support for original audio download; rename
Renamed `ogg' to `webm_audio' in core__file_keynames
Diffstat (limited to 'mediagoblin/db/sql/migrations.py')
-rw-r--r--mediagoblin/db/sql/migrations.py20
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')
+ )