aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db/sql/migrations.py
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2012-05-20 15:24:02 -0500
committerChristopher Allan Webber <cwebber@dustycloud.org>2012-05-20 15:24:37 -0500
commit758def22b82f32d5c399148bdc2b4a81b8e3c700 (patch)
tree72c242429f1126c1147e21ef503a00bb046b8a2e /mediagoblin/db/sql/migrations.py
parenta8acb5a387fd8b7365e6762d1f0573262ad5f596 (diff)
parentb781c3c9281b0356a8b7cc18065610dfccad7fcf (diff)
downloadmediagoblin-758def22b82f32d5c399148bdc2b4a81b8e3c700.tar.lz
mediagoblin-758def22b82f32d5c399148bdc2b4a81b8e3c700.tar.xz
mediagoblin-758def22b82f32d5c399148bdc2b4a81b8e3c700.zip
Merge branch 'master' of gitorious.org:mediagoblin/mediagoblin
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')
+ )